Class: PostRunner::DailyMonitoringAnalyzer::MonitoringSample
- Inherits:
-
Object
- Object
- PostRunner::DailyMonitoringAnalyzer::MonitoringSample
- Defined in:
- lib/postrunner/DailyMonitoringAnalyzer.rb
Instance Attribute Summary collapse
-
#active_calories ⇒ Object
readonly
Returns the value of attribute active_calories.
-
#activity_type ⇒ Object
readonly
Returns the value of attribute activity_type.
-
#cycles ⇒ Object
readonly
Returns the value of attribute cycles.
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#floors_climbed ⇒ Object
readonly
Returns the value of attribute floors_climbed.
-
#floors_descended ⇒ Object
readonly
Returns the value of attribute floors_descended.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#weekly_moderate_activity_minutes ⇒ Object
readonly
Returns the value of attribute weekly_moderate_activity_minutes.
-
#weekly_vigorous_activity_minutes ⇒ Object
readonly
Returns the value of attribute weekly_vigorous_activity_minutes.
Instance Method Summary collapse
-
#initialize(m) ⇒ MonitoringSample
constructor
A new instance of MonitoringSample.
Constructor Details
#initialize(m) ⇒ MonitoringSample
Returns a new instance of MonitoringSample.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 28 def initialize(m) @timestamp = m. types = [ 'generic', 'running', 'cycling', 'transition', 'fitness_equipment', 'swimming', 'walking', 'unknown7', 'resting', 'unknown9' ] if (cati = m.current_activity_type_intensity) @activity_type = types[cati & 0x1F] @activity_intensity = (cati >> 5) & 0x7 else @activity_type = m.activity_type end @active_time = m.active_time @active_calories = m.active_calories @ascent = m.ascent @descent = m.descent @floors_climbed = m.floors_climbed @floors_descended = m.floors_descended @cycles = m.cycles @distance = m.distance @duration_min = m.duration_min @heart_rate = m.heart_rate @steps = m.steps @weekly_moderate_activity_minutes = m.weekly_moderate_activity_minutes @weekly_vigorous_activity_minutes = m.weekly_vigorous_activity_minutes end |
Instance Attribute Details
#active_calories ⇒ Object (readonly)
Returns the value of attribute active_calories.
23 24 25 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 23 def active_calories @active_calories end |
#activity_type ⇒ Object (readonly)
Returns the value of attribute activity_type.
23 24 25 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 23 def activity_type @activity_type end |
#cycles ⇒ Object (readonly)
Returns the value of attribute cycles.
23 24 25 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 23 def cycles @cycles end |
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
23 24 25 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 23 def distance @distance end |
#floors_climbed ⇒ Object (readonly)
Returns the value of attribute floors_climbed.
23 24 25 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 23 def floors_climbed @floors_climbed end |
#floors_descended ⇒ Object (readonly)
Returns the value of attribute floors_descended.
23 24 25 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 23 def floors_descended @floors_descended end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
23 24 25 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 23 def steps @steps end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
23 24 25 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 23 def @timestamp end |
#weekly_moderate_activity_minutes ⇒ Object (readonly)
Returns the value of attribute weekly_moderate_activity_minutes.
23 24 25 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 23 def weekly_moderate_activity_minutes @weekly_moderate_activity_minutes end |
#weekly_vigorous_activity_minutes ⇒ Object (readonly)
Returns the value of attribute weekly_vigorous_activity_minutes.
23 24 25 |
# File 'lib/postrunner/DailyMonitoringAnalyzer.rb', line 23 def weekly_vigorous_activity_minutes @weekly_vigorous_activity_minutes end |