Class: TCXReader::Point
- Inherits:
-
Object
- Object
- TCXReader::Point
- Defined in:
- lib/tcx_reader/point.rb
Instance Attribute Summary collapse
-
#cadence ⇒ Object
Returns the value of attribute cadence.
-
#distance ⇒ Object
Returns the value of attribute distance.
-
#hr ⇒ Object
Returns the value of attribute hr.
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#lon ⇒ Object
Returns the value of attribute lon.
-
#speed ⇒ Object
Returns the value of attribute speed.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(point) ⇒ Point
constructor
A new instance of Point.
Constructor Details
#initialize(point) ⇒ Point
Returns a new instance of Point.
27 28 29 30 31 32 33 34 35 |
# File 'lib/tcx_reader/point.rb', line 27 def initialize(point) @time = Time.parse(point.at_css("Time")) @lat = point.at_css("Position LatitudeDegrees").text.to_f rescue nil @lon = point.at_css("Position LongitudeDegrees").text.to_f rescue nil @hr = point.at_css("HeartRateBpm Value").text.to_i rescue nil @distance = point.at_css("DistanceMeters").text.to_f rescue nil @speed = point.at_css("Speed").text.to_f rescue nil @cadence = point.at_css("RunCadence").text.to_i rescue nil end |
Instance Attribute Details
#cadence ⇒ Object
Returns the value of attribute cadence.
25 26 27 |
# File 'lib/tcx_reader/point.rb', line 25 def cadence @cadence end |
#distance ⇒ Object
Returns the value of attribute distance.
25 26 27 |
# File 'lib/tcx_reader/point.rb', line 25 def distance @distance end |
#hr ⇒ Object
Returns the value of attribute hr.
25 26 27 |
# File 'lib/tcx_reader/point.rb', line 25 def hr @hr end |
#lat ⇒ Object
Returns the value of attribute lat.
25 26 27 |
# File 'lib/tcx_reader/point.rb', line 25 def lat @lat end |
#lon ⇒ Object
Returns the value of attribute lon.
25 26 27 |
# File 'lib/tcx_reader/point.rb', line 25 def lon @lon end |
#speed ⇒ Object
Returns the value of attribute speed.
25 26 27 |
# File 'lib/tcx_reader/point.rb', line 25 def speed @speed end |
#time ⇒ Object
Returns the value of attribute time.
25 26 27 |
# File 'lib/tcx_reader/point.rb', line 25 def time @time end |