Class: GoobyLap
- Inherits:
-
GoobyXmlObject
- Object
- GoobyBaseObject
- GoobyXmlObject
- GoobyLap
- Defined in:
- lib/gooby_lap.rb
Overview
Gooby = Google APIs + Ruby. Copyright 2009 by Chris Joakim. Gooby is available under GNU General Public License (GPL) license.
Constant Summary
Constants inherited from GoobyBaseObject
GoobyBaseObject::KILOMETERS_PER_MILE, GoobyBaseObject::METERS_PER_FOOT, GoobyBaseObject::MILES_PER_KILOMETER, GoobyBaseObject::SECONDS_PER_HOUR, GoobyBaseObject::UOM_KILOMETERS, GoobyBaseObject::UOM_MILES, GoobyBaseObject::UOM_YARDS, GoobyBaseObject::YARDS_PER_KILOMETER, GoobyBaseObject::YARDS_PER_MILE
Instance Attribute Summary
Attributes inherited from GoobyXmlObject
Instance Method Summary collapse
- #distance_in_meters ⇒ Object
- #dump ⇒ Object
-
#initialize(attrs = nil) ⇒ GoobyLap
constructor
A new instance of GoobyLap.
- #max_speed ⇒ Object
- #seconds ⇒ Object
- #start_time ⇒ Object
Methods inherited from GoobyXmlObject
#add, #base_initialize, #get, #id, #sequence, #set
Methods inherited from GoobyBaseObject
boolean_config_value, config_value, get_config, set_config
Methods included from GoobyIO
#read_file_as_lines, #write_file, #write_lines
Methods included from GoobyIntrospection
Methods included from GoobyEnvironment
#array_param, #boolean_param, #command_line_arg, #float_param, #integer_param, #string_param
Constructor Details
#initialize(attrs = nil) ⇒ GoobyLap
Returns a new instance of GoobyLap.
10 11 12 13 14 15 |
# File 'lib/gooby_lap.rb', line 10 def initialize(attrs=nil) base_initialize if attrs attrs.keys.each { | name | set(name, attrs[name]) } end end |
Instance Method Details
#distance_in_meters ⇒ Object
25 26 27 |
# File 'lib/gooby_lap.rb', line 25 def distance_in_meters get('DistanceMeters').to_f end |
#dump ⇒ Object
33 34 35 |
# File 'lib/gooby_lap.rb', line 33 def dump puts "Lap: #{id}, #{sequence}, #{start_time}, #{distance_in_meters}, #{max_speed}" end |
#max_speed ⇒ Object
29 30 31 |
# File 'lib/gooby_lap.rb', line 29 def max_speed get('MaximumSpeed').to_f end |
#seconds ⇒ Object
21 22 23 |
# File 'lib/gooby_lap.rb', line 21 def seconds get('TotalTimeSeconds').to_f end |
#start_time ⇒ Object
17 18 19 |
# File 'lib/gooby_lap.rb', line 17 def start_time get('StartTime') end |