Class: GitFit::Parser::GPX
Constant Summary collapse
- NS =
{ gpx: 'http://www.topografix.com/GPX/1/1' }.freeze
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from GitFit::Parser::Base
Instance Method Details
#call(input) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/git_fit/parser/gpx.rb', line 11 def call(input) doc = input.is_a?(String) ? Nokogiri::XML(input) : input doc.remove_namespaces! tracks = doc.xpath('//trk') return [] if tracks.empty? tracks.filter_map { |trk| parse_track(trk) } end |