Class: ReadGpx

Inherits:
Object
  • Object
show all
Defined in:
lib/gpx_manipulator/read_gpx.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file:) ⇒ ReadGpx

Returns a new instance of ReadGpx.



8
9
10
# File 'lib/gpx_manipulator/read_gpx.rb', line 8

def initialize(file:)
  @file = file
end

Instance Attribute Details

#tracksObject (readonly)

Returns the value of attribute tracks.



6
7
8
# File 'lib/gpx_manipulator/read_gpx.rb', line 6

def tracks
  @tracks
end

Instance Method Details

#readObject



12
13
14
15
# File 'lib/gpx_manipulator/read_gpx.rb', line 12

def read
  gpx_object = GPX::GPXFile.new(gpx_file: @file)
  @tracks = gpx_object.tracks
end