Class: GpxRuby::Gpx::Track::Point

Inherits:
Point
  • Object
show all
Defined in:
lib/gpx_ruby/gpx/track.rb

Constant Summary

Constants inherited from Point

Point::RADIUS_KM

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Point

#+, #/, #[], #distance, #to_hash, #to_s

Constructor Details

#initialize(params) ⇒ Point

Returns a new instance of Point.



49
50
51
52
53
54
# File 'lib/gpx_ruby/gpx/track.rb', line 49

def initialize(params)
  @lat = params[:lat]
  @lon = params[:lon]
  @time = params[:time]
  @elevation = params[:elevation]
end

Instance Attribute Details

#elevationObject

Returns the value of attribute elevation.



47
48
49
# File 'lib/gpx_ruby/gpx/track.rb', line 47

def elevation
  @elevation
end

#latObject

Returns the value of attribute lat.



47
48
49
# File 'lib/gpx_ruby/gpx/track.rb', line 47

def lat
  @lat
end

#lonObject

Returns the value of attribute lon.



47
48
49
# File 'lib/gpx_ruby/gpx/track.rb', line 47

def lon
  @lon
end

#timeObject

Returns the value of attribute time.



47
48
49
# File 'lib/gpx_ruby/gpx/track.rb', line 47

def time
  @time
end

Instance Method Details

#to_aObject



56
57
58
# File 'lib/gpx_ruby/gpx/track.rb', line 56

def to_a
  [@lat,@lon]
end