Class: Joule::Base::Parser
- Inherits:
-
Object
- Object
- Joule::Base::Parser
- Defined in:
- lib/joule/base/parser.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#workout ⇒ Object
Returns the value of attribute workout.
Instance Method Summary collapse
-
#initialize(data) ⇒ Parser
constructor
A new instance of Parser.
- #parse(options = {}) ⇒ Object
- #parse_properties ⇒ Object
- #parse_workout ⇒ Object
Methods included from Calculator::PeakPowerCalculator
#calculate_peak_power_value, #calculate_peak_power_values
Methods included from Calculator::MarkerCalculator
#calculate_marker_averages, #calculate_marker_maximums, #calculate_marker_totals, #calculate_marker_training_metrics, #calculate_marker_values
Constructor Details
Instance Attribute Details
#workout ⇒ Object
Returns the value of attribute workout.
7 8 9 |
# File 'lib/joule/base/parser.rb', line 7 def workout @workout end |
Instance Method Details
#parse(options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/joule/base/parser.rb', line 25 def parse( = {}) parse_properties parse_workout if([:calculate_marker_values]) calculate_marker_values() end if([:calculate_peak_power_values]) calculate_peak_power_values(:durations => [:durations], :total_duration => @workout.markers.first.duration_seconds) end @workout end |
#parse_properties ⇒ Object
44 45 46 |
# File 'lib/joule/base/parser.rb', line 44 def parse_properties raise NotImplementedError end |
#parse_workout ⇒ Object
40 41 42 |
# File 'lib/joule/base/parser.rb', line 40 def parse_workout raise NotImplementedError end |