Class: TodaysPlan::Activity::Summary

Inherits:
Object
  • Object
show all
Defined in:
lib/todays_plan/activity/summary.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fields) ⇒ Summary

Returns a new instance of Summary.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/todays_plan/activity/summary.rb', line 43

def initialize(fields)
  @min_watts = fields['minWatts']
  @avg_watts = fields['avgWatts']
  @max_watts = fields['maxWatts']
  @threshold_watts =  fields['thresholdWatts']
  @tscorepwr = fields['tscorepwr']
  @intensity_factor = fields['iff']
  @kj = fields['kj']
  @wkg = fields['wkg']
  @np = fields['np']
  @ef = fields['ef']
  @vi = fields['vi']
  @vo2max = fields['vo2max']
  @min_bpm = fields['minBpm']
  @avg_bpm = fields['avgBpm']
  @max_bpm = fields['maxBpm']
  @threshold_bpm =  fields['thresholdBpm']
  @tscorehr = fields['tscorehr']
  @calories = fields['calories']
  @min_alt = fields['minAlt']
  @avg_alt = fields['avgAlt']
  @max_alt = fields['maxAlt']
  @ascent = fields["ascent"]
  @descent = fields["descent"]
  @avg_speed = fields['avgSpeed']
  @max_speed = fields['maxSpeed']
  @avg_cadence = fields['avgCadence']
  @max_cadence = fields['maxCadence'] 
  @min_temp = fields['minTemp']
  @avg_temp = fields['avgTemp']
  @max_temp = fields['maxTemp']
  @idle = fields['idle']
  @distance = fields['distance']
  @ts = fields['ts']
  @power_meter = fields.has_key?('powermeter') ? fields['powermeter']["name"] : nil
end

Instance Attribute Details

#ascentObject (readonly)

Returns the value of attribute ascent.



29
30
31
# File 'lib/todays_plan/activity/summary.rb', line 29

def ascent
  @ascent
end

#avg_altObject (readonly)

Returns the value of attribute avg_alt.



27
28
29
# File 'lib/todays_plan/activity/summary.rb', line 27

def avg_alt
  @avg_alt
end

#avg_bpmObject (readonly)

Returns the value of attribute avg_bpm.



20
21
22
# File 'lib/todays_plan/activity/summary.rb', line 20

def avg_bpm
  @avg_bpm
end

#avg_cadenceObject (readonly)

Returns the value of attribute avg_cadence.



36
37
38
# File 'lib/todays_plan/activity/summary.rb', line 36

def avg_cadence
  @avg_cadence
end

#avg_speedObject (readonly)

Returns the value of attribute avg_speed.



31
32
33
# File 'lib/todays_plan/activity/summary.rb', line 31

def avg_speed
  @avg_speed
end

#avg_tempObject (readonly)

Returns the value of attribute avg_temp.



34
35
36
# File 'lib/todays_plan/activity/summary.rb', line 34

def avg_temp
  @avg_temp
end

#avg_wattsObject (readonly)

Returns the value of attribute avg_watts.



7
8
9
# File 'lib/todays_plan/activity/summary.rb', line 7

def avg_watts
  @avg_watts
end

#caloriesObject (readonly)

Returns the value of attribute calories.



25
26
27
# File 'lib/todays_plan/activity/summary.rb', line 25

def calories
  @calories
end

#descentObject (readonly)

Returns the value of attribute descent.



30
31
32
# File 'lib/todays_plan/activity/summary.rb', line 30

def descent
  @descent
end

#distanceObject (readonly)

Returns the value of attribute distance.



39
40
41
# File 'lib/todays_plan/activity/summary.rb', line 39

def distance
  @distance
end

#efObject (readonly)

Returns the value of attribute ef.



16
17
18
# File 'lib/todays_plan/activity/summary.rb', line 16

def ef
  @ef
end

#idleObject (readonly)

Returns the value of attribute idle.



38
39
40
# File 'lib/todays_plan/activity/summary.rb', line 38

def idle
  @idle
end

#intensity_factorObject (readonly)

Returns the value of attribute intensity_factor.



12
13
14
# File 'lib/todays_plan/activity/summary.rb', line 12

def intensity_factor
  @intensity_factor
end

#kjObject (readonly)

Returns the value of attribute kj.



13
14
15
# File 'lib/todays_plan/activity/summary.rb', line 13

def kj
  @kj
end

#max_altObject (readonly)

Returns the value of attribute max_alt.



28
29
30
# File 'lib/todays_plan/activity/summary.rb', line 28

def max_alt
  @max_alt
end

#max_bpmObject (readonly)

Returns the value of attribute max_bpm.



21
22
23
# File 'lib/todays_plan/activity/summary.rb', line 21

def max_bpm
  @max_bpm
end

#max_cadenceObject (readonly)

Returns the value of attribute max_cadence.



37
38
39
# File 'lib/todays_plan/activity/summary.rb', line 37

def max_cadence
  @max_cadence
end

#max_speedObject (readonly)

Returns the value of attribute max_speed.



32
33
34
# File 'lib/todays_plan/activity/summary.rb', line 32

def max_speed
  @max_speed
end

#max_tempObject (readonly)

Returns the value of attribute max_temp.



35
36
37
# File 'lib/todays_plan/activity/summary.rb', line 35

def max_temp
  @max_temp
end

#max_wattsObject (readonly)

Returns the value of attribute max_watts.



8
9
10
# File 'lib/todays_plan/activity/summary.rb', line 8

def max_watts
  @max_watts
end

#min_altObject (readonly)

Returns the value of attribute min_alt.



26
27
28
# File 'lib/todays_plan/activity/summary.rb', line 26

def min_alt
  @min_alt
end

#min_bpmObject (readonly)

Returns the value of attribute min_bpm.



19
20
21
# File 'lib/todays_plan/activity/summary.rb', line 19

def min_bpm
  @min_bpm
end

#min_tempObject (readonly)

Returns the value of attribute min_temp.



33
34
35
# File 'lib/todays_plan/activity/summary.rb', line 33

def min_temp
  @min_temp
end

#min_wattsObject (readonly)

Returns the value of attribute min_watts.



6
7
8
# File 'lib/todays_plan/activity/summary.rb', line 6

def min_watts
  @min_watts
end

#npObject (readonly)

Returns the value of attribute np.



15
16
17
# File 'lib/todays_plan/activity/summary.rb', line 15

def np
  @np
end

#power_meterObject (readonly)

Returns the value of attribute power_meter.



40
41
42
# File 'lib/todays_plan/activity/summary.rb', line 40

def power_meter
  @power_meter
end

#sec_in_zoneObject (readonly)

Returns the value of attribute sec_in_zone.



10
11
12
# File 'lib/todays_plan/activity/summary.rb', line 10

def sec_in_zone
  @sec_in_zone
end

#threshold_bpmObject (readonly)

Returns the value of attribute threshold_bpm.



22
23
24
# File 'lib/todays_plan/activity/summary.rb', line 22

def threshold_bpm
  @threshold_bpm
end

#threshold_wattsObject (readonly)

Returns the value of attribute threshold_watts.



9
10
11
# File 'lib/todays_plan/activity/summary.rb', line 9

def threshold_watts
  @threshold_watts
end

#tsObject (readonly)

Returns the value of attribute ts.



41
42
43
# File 'lib/todays_plan/activity/summary.rb', line 41

def ts
  @ts
end

#tscorehrObject (readonly)

Returns the value of attribute tscorehr.



23
24
25
# File 'lib/todays_plan/activity/summary.rb', line 23

def tscorehr
  @tscorehr
end

#tscorepwrObject (readonly)

Returns the value of attribute tscorepwr.



11
12
13
# File 'lib/todays_plan/activity/summary.rb', line 11

def tscorepwr
  @tscorepwr
end

#viObject (readonly)

Returns the value of attribute vi.



17
18
19
# File 'lib/todays_plan/activity/summary.rb', line 17

def vi
  @vi
end

#vo2maxObject (readonly)

Returns the value of attribute vo2max.



18
19
20
# File 'lib/todays_plan/activity/summary.rb', line 18

def vo2max
  @vo2max
end

#wkgObject (readonly)

Returns the value of attribute wkg.



14
15
16
# File 'lib/todays_plan/activity/summary.rb', line 14

def wkg
  @wkg
end

Class Method Details

.find(id, activity = 'workouts', client = nil) ⇒ Object



81
82
83
# File 'lib/todays_plan/activity/summary.rb', line 81

def self.find(id, activity = 'workouts',client=nil)
  new(Connector.new("/plans/#{activity}/fragment/summary/#{id}", client).get())
end