Class: GPX::Segment

Inherits:
Object
  • Object
show all
Defined in:
lib/gpx_kml/gpx/segment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(segment, track) ⇒ Segment

Returns a new instance of Segment.



9
10
11
12
13
14
15
# File 'lib/gpx_kml/gpx/segment.rb', line 9

def initialize(segment, track)
  return unless segment.is_a?(Nokogiri::XML::Element) && track.is_a?(GPX::Track)
  return if segment.xpath('self::xmlns:trkseg').empty?

  @points = _points segment
  @track = track
end

Instance Attribute Details

#pointsObject (readonly)

Returns the value of attribute points.



17
18
19
# File 'lib/gpx_kml/gpx/segment.rb', line 17

def points
  @points
end

#trackObject (readonly)

Returns the value of attribute track.



17
18
19
# File 'lib/gpx_kml/gpx/segment.rb', line 17

def track
  @track
end