Class: TCXReader::Activity
- Inherits:
-
Object
- Object
- TCXReader::Activity
- Defined in:
- lib/tcx_reader/activity.rb
Instance Attribute Summary collapse
-
#activity_id ⇒ Object
Returns the value of attribute activity_id.
-
#laps ⇒ Object
Returns the value of attribute laps.
-
#sport ⇒ Object
Returns the value of attribute sport.
Instance Method Summary collapse
-
#initialize(activity) ⇒ Activity
constructor
A new instance of Activity.
Constructor Details
#initialize(activity) ⇒ Activity
Returns a new instance of Activity.
27 28 29 30 31 32 33 34 35 |
# File 'lib/tcx_reader/activity.rb', line 27 def initialize(activity) @sport = activity["Sport"] rescue "" @activity_id = activity.at_css("Id") @laps = [] activity.css("Lap").each do |lap| lap = Lap.new(lap) @laps << lap end end |
Instance Attribute Details
#activity_id ⇒ Object
Returns the value of attribute activity_id.
25 26 27 |
# File 'lib/tcx_reader/activity.rb', line 25 def activity_id @activity_id end |
#laps ⇒ Object
Returns the value of attribute laps.
25 26 27 |
# File 'lib/tcx_reader/activity.rb', line 25 def laps @laps end |
#sport ⇒ Object
Returns the value of attribute sport.
25 26 27 |
# File 'lib/tcx_reader/activity.rb', line 25 def sport @sport end |