class LemonadeStand::RainEvent

Public Instance Methods

chance_of_rain() click to toggle source
# File lib/lemonade_stand/events/rain_event.rb, line 5
def chance_of_rain
  (rand * 0.5 + 0.3).round(2)
end
modify(choice) click to toggle source
# File lib/lemonade_stand/events/rain_event.rb, line 9
def modify choice
  ((1 - chance_of_rain) * choice.max_sales).round
end