Class: Rubybody::Person
- Inherits:
-
Object
- Object
- Rubybody::Person
- Defined in:
- lib/rubybody/person.rb
Instance Attribute Summary collapse
-
#activity ⇒ Object
Returns the value of attribute activity.
-
#age ⇒ Object
Returns the value of attribute age.
-
#bodyfat ⇒ Object
Returns the value of attribute bodyfat.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#height_in_cm ⇒ Object
Returns the value of attribute height_in_cm.
-
#waist ⇒ Object
Returns the value of attribute waist.
-
#weight_in_kg ⇒ Object
Returns the value of attribute weight_in_kg.
Instance Method Summary collapse
- #bmr(method = :mifflin_st_jeor) ⇒ Object
-
#initialize(weight_in_kg, height_in_cm, age, gender, activity = :sedentary, bodyfat = 0, waist = 0) ⇒ Person
constructor
All units are in the SI standard.
- #tdee ⇒ Object
Constructor Details
#initialize(weight_in_kg, height_in_cm, age, gender, activity = :sedentary, bodyfat = 0, waist = 0) ⇒ Person
All units are in the SI standard
8 9 10 11 12 13 14 15 16 |
# File 'lib/rubybody/person.rb', line 8 def initialize(weight_in_kg, height_in_cm, age, gender, activity=:sedentary, bodyfat=0, waist=0) self.weight_in_kg = weight_in_kg self.height_in_cm = height_in_cm self.age = age self.gender = gender self.activity = activity self.bodyfat = bodyfat self.waist = waist end |
Instance Attribute Details
#activity ⇒ Object
Returns the value of attribute activity.
5 6 7 |
# File 'lib/rubybody/person.rb', line 5 def activity @activity end |
#age ⇒ Object
Returns the value of attribute age.
5 6 7 |
# File 'lib/rubybody/person.rb', line 5 def age @age end |
#bodyfat ⇒ Object
Returns the value of attribute bodyfat.
5 6 7 |
# File 'lib/rubybody/person.rb', line 5 def bodyfat @bodyfat end |
#gender ⇒ Object
Returns the value of attribute gender.
5 6 7 |
# File 'lib/rubybody/person.rb', line 5 def gender @gender end |
#height_in_cm ⇒ Object
Returns the value of attribute height_in_cm.
5 6 7 |
# File 'lib/rubybody/person.rb', line 5 def height_in_cm @height_in_cm end |
#waist ⇒ Object
Returns the value of attribute waist.
5 6 7 |
# File 'lib/rubybody/person.rb', line 5 def waist @waist end |
#weight_in_kg ⇒ Object
Returns the value of attribute weight_in_kg.
5 6 7 |
# File 'lib/rubybody/person.rb', line 5 def weight_in_kg @weight_in_kg end |