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