Class: Uruz::Vo2max

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

Constant Summary collapse

GENDER =
[ :male, :female ]
CLASSIFICATIONS =
[ :very_weak, :weak, :middle, :good, :excellent, :higher ]

Class Method Summary collapse

Class Method Details

.calculate(distance) ⇒ Object



6
7
8
# File 'lib/uruz/vo2max.rb', line 6

def self.calculate(distance)
	vo2max_result = (distance - 504.1) / 44.8
end

.classification(distance, age, gender) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/uruz/vo2max.rb', line 10

def self.classification(distance, age, gender)
	vo2max_result = calculate(distance)

	vo2max_gender_data = gender.eql?(:male) ? $vo2max_male_data : $vo2max_female_data

	classification = result_by_gender(vo2max_gender_data, age, vo2max_result)
	classification.first
end