Class: MonthlyPlan
- Inherits:
-
DailyPlanDecorator
- Object
- DailyPlanDecorator
- MonthlyPlan
- Defined in:
- lib/monthly_plan.rb
Instance Method Summary collapse
- #budget ⇒ Object
- #generate_meal_plan ⇒ Object
-
#initialize(daily_plan) ⇒ MonthlyPlan
constructor
A new instance of MonthlyPlan.
Constructor Details
#initialize(daily_plan) ⇒ MonthlyPlan
Returns a new instance of MonthlyPlan.
5 6 7 |
# File 'lib/monthly_plan.rb', line 5 def initialize(daily_plan) super(daily_plan) end |
Instance Method Details
#budget ⇒ Object
9 10 11 |
# File 'lib/monthly_plan.rb', line 9 def budget @daily_plan / 31 end |
#generate_meal_plan ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/monthly_plan.rb', line 13 def generate_meal_plan meal_plan = Array.new 31.times do |n| meal_plan.push(@daily_plan.generate_meal_plan) end return meal_plan end |