Class: GPX::Point
- Inherits:
-
Object
- Object
- GPX::Point
- Defined in:
- lib/gpx_kml/gpx/point.rb
Overview
Docu
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#elevation ⇒ Object
readonly
Returns the value of attribute elevation.
-
#father ⇒ Object
readonly
Returns the value of attribute father.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(point, father) ⇒ Point
constructor
A new instance of Point.
Constructor Details
#initialize(point, father) ⇒ Point
Returns a new instance of Point.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gpx_kml/gpx/point.rb', line 7 def initialize(point, father) return unless point.is_a? Nokogiri::XML::Element return if point.xpath('self::*[self::xmlns:wpt or self::xmlns:rtept or self::xmlns:trkpt]').empty? @longitude = point.xpath('@lon').to_s @latitude = point.xpath('@lat').to_s @elevation = point.xpath('./xmlns:ele/text()').to_s @name = point.xpath('./xmlns:name/text()').to_s @description = point.xpath('./xmlns:desc/text()').to_s @link = point.xpath('./xmlns:link/@href').to_s return unless valid_father? father @father = father end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
23 24 25 |
# File 'lib/gpx_kml/gpx/point.rb', line 23 def description @description end |
#elevation ⇒ Object (readonly)
Returns the value of attribute elevation.
23 24 25 |
# File 'lib/gpx_kml/gpx/point.rb', line 23 def elevation @elevation end |
#father ⇒ Object (readonly)
Returns the value of attribute father.
23 24 25 |
# File 'lib/gpx_kml/gpx/point.rb', line 23 def father @father end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
23 24 25 |
# File 'lib/gpx_kml/gpx/point.rb', line 23 def latitude @latitude end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
23 24 25 |
# File 'lib/gpx_kml/gpx/point.rb', line 23 def link @link end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
23 24 25 |
# File 'lib/gpx_kml/gpx/point.rb', line 23 def longitude @longitude end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/gpx_kml/gpx/point.rb', line 23 def name @name end |