Class: GenerateDiet
- Inherits:
-
Object
- Object
- GenerateDiet
- Defined in:
- lib/generate.rb
Instance Attribute Summary collapse
-
#date_started ⇒ Object
readonly
Returns the value of attribute date_started.
-
#initial_weight ⇒ Object
readonly
Returns the value of attribute initial_weight.
-
#plan ⇒ Object
Returns the value of attribute plan.
-
#target_weight ⇒ Object
readonly
Returns the value of attribute target_weight.
Instance Method Summary collapse
- #get_plan ⇒ Object
-
#initialize(plan, initial_weight, target_weight, date_started) ⇒ GenerateDiet
constructor
A new instance of GenerateDiet.
Constructor Details
#initialize(plan, initial_weight, target_weight, date_started) ⇒ GenerateDiet
Returns a new instance of GenerateDiet.
12 13 14 15 16 17 |
# File 'lib/generate.rb', line 12 def initialize(plan, initial_weight, target_weight, date_started) @initial_weight = initial_weight @target_weight = target_weight @date_started = date_started @plan = plan end |
Instance Attribute Details
#date_started ⇒ Object (readonly)
Returns the value of attribute date_started.
10 11 12 |
# File 'lib/generate.rb', line 10 def date_started @date_started end |
#initial_weight ⇒ Object (readonly)
Returns the value of attribute initial_weight.
10 11 12 |
# File 'lib/generate.rb', line 10 def initial_weight @initial_weight end |
#plan ⇒ Object
Returns the value of attribute plan.
9 10 11 |
# File 'lib/generate.rb', line 9 def plan @plan end |
#target_weight ⇒ Object (readonly)
Returns the value of attribute target_weight.
10 11 12 |
# File 'lib/generate.rb', line 10 def target_weight @target_weight end |
Instance Method Details
#get_plan ⇒ Object
19 20 21 |
# File 'lib/generate.rb', line 19 def get_plan @plan.generate_diet(self) end |