Class: Uruz::User
- Inherits:
-
Object
- Object
- Uruz::User
- Defined in:
- lib/uruz/user.rb
Instance Attribute Summary collapse
-
#age ⇒ Object
Returns the value of attribute age.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#height ⇒ Object
Returns the value of attribute height.
-
#weight ⇒ Object
Returns the value of attribute weight.
Instance Method Summary collapse
- #imc ⇒ Object
-
#initialize(age, height, weight, gender) ⇒ User
constructor
A new instance of User.
- #vo2max(distance) ⇒ Object
Constructor Details
#initialize(age, height, weight, gender) ⇒ User
Returns a new instance of User.
5 6 7 8 9 10 |
# File 'lib/uruz/user.rb', line 5 def initialize(age, height, weight, gender) self.age = age self.height = height self.weight = weight self.gender = gender end |
Instance Attribute Details
#age ⇒ Object
Returns the value of attribute age.
3 4 5 |
# File 'lib/uruz/user.rb', line 3 def age @age end |
#gender ⇒ Object
Returns the value of attribute gender.
3 4 5 |
# File 'lib/uruz/user.rb', line 3 def gender @gender end |
#height ⇒ Object
Returns the value of attribute height.
3 4 5 |
# File 'lib/uruz/user.rb', line 3 def height @height end |
#weight ⇒ Object
Returns the value of attribute weight.
3 4 5 |
# File 'lib/uruz/user.rb', line 3 def weight @weight end |
Instance Method Details
#imc ⇒ Object
12 13 14 |
# File 'lib/uruz/user.rb', line 12 def imc IMC.calculate(self.height, self.weight) end |
#vo2max(distance) ⇒ Object
16 17 18 |
# File 'lib/uruz/user.rb', line 16 def vo2max(distance) classification = Uruz::Vo2max.classification(distance, self.age, self.gender) end |