質問するログイン新規登録

回答編集履歴

1

訂正

2020/05/09 08:54

投稿

winterboum
winterboum

スコア23678

answer CHANGED
@@ -7,4 +7,12 @@
7
7
  沢山有るなら
8
8
  `if [send_content1, send_content2, send_content3, send_content4, end_content5].any?{| content | content == "foo"}`
9
9
  とか
10
- `if (1..183628).any?{|i| send("send_content#{i}") == "foo" }`
10
+ `if (1..183628).any?{|i| send("send_content#{i}") == "foo" }`
11
+
12
+ 訂正
13
+ 一つでも "foo"で無いものがあったら 失敗 なのかな?
14
+ 上のは 一つでも "foo"があればOKです。
15
+ 全部が"foo"でなければならないのなら
16
+ `if send_content1 == "foo" && send_content2 == "foo"`
17
+
18
+ した二つは any? を all? に変更です