Class: GenerateDiet

Inherits:
Object
  • Object
show all
Defined in:
lib/generate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_startedObject (readonly)

Returns the value of attribute date_started.



10
11
12
# File 'lib/generate.rb', line 10

def date_started
  @date_started
end

#initial_weightObject (readonly)

Returns the value of attribute initial_weight.



10
11
12
# File 'lib/generate.rb', line 10

def initial_weight
  @initial_weight
end

#planObject

Returns the value of attribute plan.



9
10
11
# File 'lib/generate.rb', line 9

def plan
  @plan
end

#target_weightObject (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_planObject



19
20
21
# File 'lib/generate.rb', line 19

def get_plan
    @plan.generate_diet(self)
end