Ruby
sum関数でエラーがでた 下記のメソッドを使いたいとします。 def calc_score [@first_shot.point, @second_shot.point, @third_shot.point].sum end インスタンスはこうやって作られます。 def initialize(first_shot, second_shot = nil, third_shot = nil)…
sum関数でエラーがでた 下記のメソッドを使いたいとします。 def calc_score [@first_shot.point, @second_shot.point, @third_shot.point].sum end インスタンスはこうやって作られます。 def initialize(first_shot, second_shot = nil, third_shot = nil)…