Class: Uruz::User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#ageObject

Returns the value of attribute age.



3
4
5
# File 'lib/uruz/user.rb', line 3

def age
  @age
end

#genderObject

Returns the value of attribute gender.



3
4
5
# File 'lib/uruz/user.rb', line 3

def gender
  @gender
end

#heightObject

Returns the value of attribute height.



3
4
5
# File 'lib/uruz/user.rb', line 3

def height
  @height
end

#weightObject

Returns the value of attribute weight.



3
4
5
# File 'lib/uruz/user.rb', line 3

def weight
  @weight
end

Instance Method Details

#imcObject



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