回答編集履歴
1
追記
test
CHANGED
@@ -1 +1,45 @@
|
|
1
1
|
インデントが崩れてるせいでif内に見えてるだけのように思います。
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
---
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
**追記**
|
10
|
+
|
11
|
+
予想されるコード全文
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
```rb
|
16
|
+
|
17
|
+
class Menu
|
18
|
+
|
19
|
+
def calc # メソッド名・引数はしらん
|
20
|
+
|
21
|
+
# なんらかのコード
|
22
|
+
|
23
|
+
if count >= 1 && Menu.is_discount_day?
|
24
|
+
|
25
|
+
total_price -= 100
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
return total_price
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
def Menu.is_discount_day?
|
36
|
+
|
37
|
+
today = Date.today
|
38
|
+
|
39
|
+
return today.sunday?
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
```
|