Class: TodaysPlan::Activity::Power

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fields) ⇒ Power

Returns a new instance of Power.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/todays_plan/activity/power.rb', line 20

def initialize(fields)
  @min_watts = fields['minWatts']
  @avg_watts = fields['avgWatts']
  @max_watts = fields['maxWatts']
  @threshold_watts =  fields['thresholdWatts']
  @sec_in_zone = fields["secsInZonePwr"]
  @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']
end

Instance Attribute Details

#avg_wattsObject (readonly)

Returns the value of attribute avg_watts.



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

def avg_watts
  @avg_watts
end

#efObject (readonly)

Returns the value of attribute ef.



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

def ef
  @ef
end

#intensity_factorObject (readonly)

Returns the value of attribute intensity_factor.



12
13
14
# File 'lib/todays_plan/activity/power.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/power.rb', line 13

def kj
  @kj
end

#max_wattsObject (readonly)

Returns the value of attribute max_watts.



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

def max_watts
  @max_watts
end

#min_wattsObject (readonly)

Returns the value of attribute min_watts.



6
7
8
# File 'lib/todays_plan/activity/power.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/power.rb', line 15

def np
  @np
end

#sec_in_zoneObject (readonly)

Returns the value of attribute sec_in_zone.



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

def sec_in_zone
  @sec_in_zone
end

#threshold_wattsObject (readonly)

Returns the value of attribute threshold_watts.



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

def threshold_watts
  @threshold_watts
end

#tscorepwrObject (readonly)

Returns the value of attribute tscorepwr.



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

def tscorepwr
  @tscorepwr
end

#viObject (readonly)

Returns the value of attribute vi.



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

def vi
  @vi
end

#vo2maxObject (readonly)

Returns the value of attribute vo2max.



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

def vo2max
  @vo2max
end

#wkgObject (readonly)

Returns the value of attribute wkg.



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

def wkg
  @wkg
end

Class Method Details

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



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

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

end