Class: GpxTrackGenerator::GpxFile
- Inherits:
-
Object
- Object
- GpxTrackGenerator::GpxFile
- Defined in:
- lib/gpx_track_generator/gpx_file.rb
Overview
A gpx file
Instance Method Summary collapse
-
#file_name ⇒ Object
Return file name.
-
#initialize(path) ⇒ GpxFile
constructor
A new instance of GpxFile.
-
#nodes ⇒ Object
Return nodes.
Constructor Details
#initialize(path) ⇒ GpxFile
Returns a new instance of GpxFile.
11 12 13 |
# File 'lib/gpx_track_generator/gpx_file.rb', line 11 def initialize(path) @path = path end |
Instance Method Details
#file_name ⇒ Object
Return file name
27 28 29 |
# File 'lib/gpx_track_generator/gpx_file.rb', line 27 def file_name File.basename(path) end |
#nodes ⇒ Object
Return nodes
16 17 18 19 20 21 22 23 24 |
# File 'lib/gpx_track_generator/gpx_file.rb', line 16 def nodes document = Nokogiri::XML('') node_set = Nokogiri::XML::NodeSet.new(document) node_set += extract_route_nodes unless extract_route_nodes.empty? node_set += extract_track_nodes unless extract_track_nodes.empty? node_set end |