Class: GPX::Route
- Inherits:
-
Object
- Object
- GPX::Route
- Defined in:
- lib/gpx_kml/gpx/route.rb
Overview
Docu
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#points ⇒ Object
readonly
Returns the value of attribute points.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(route) ⇒ Route
constructor
A new instance of Route.
Constructor Details
#initialize(route) ⇒ Route
Returns a new instance of Route.
8 9 10 11 12 13 14 15 16 |
# File 'lib/gpx_kml/gpx/route.rb', line 8 def initialize(route) return unless route.is_a?(Nokogiri::XML::Element) && !route.xpath('self::xmlns:rte').empty? @name = route.xpath('./xmlns:name/text()').to_s @number = route.xpath('./xmlns:number/text()').to_s @description = route.xpath('./xmlns:desc/text()').to_s @link = route.xpath('./xmlns:link/@href').to_s @points = _points route end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
18 19 20 |
# File 'lib/gpx_kml/gpx/route.rb', line 18 def description @description end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
18 19 20 |
# File 'lib/gpx_kml/gpx/route.rb', line 18 def link @link end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
18 19 20 |
# File 'lib/gpx_kml/gpx/route.rb', line 18 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
18 19 20 |
# File 'lib/gpx_kml/gpx/route.rb', line 18 def number @number end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
18 19 20 |
# File 'lib/gpx_kml/gpx/route.rb', line 18 def points @points end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
18 19 20 |
# File 'lib/gpx_kml/gpx/route.rb', line 18 def time @time end |