Class: Fit4Ruby::Lap

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

Instance Method Summary collapse

Instance Method Details

#set(field, value) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fit4ruby/Lap.rb', line 17

def set(field, value)
  case field
  when 'start_time'
    @start_time = value
  when 'total_timer_time'
    @duration = value
  when 'avg_speed'
    @avg_speed = value
  when 'avg_heart_rate'
    @avg_heart_rate = value
  when 'max_heart_rate'
    @max_heart_rate = value
  when 'avg_vertical_oscillation'
    @avg_vertical_oscillation = value
  when 'avg_stance_time'
    @avg_stance_time = value
  when 'avg_running_cadence'
    @avg_running_cadence = 2 * value
  when 'avg_fraction_cadence'
    @avg_running_cadence += 2 * value
  else
  end
end