Class: SeametrixRuby::Models::Waypoint
- Inherits:
-
Object
- Object
- SeametrixRuby::Models::Waypoint
- Defined in:
- lib/seametrix_ruby/models/waypoint.rb
Instance Attribute Summary collapse
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#lon ⇒ Object
Returns the value of attribute lon.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Waypoint
constructor
A new instance of Waypoint.
- #latitude ⇒ Object
- #latitude=(value) ⇒ Object
- #longitude ⇒ Object
- #longitude=(value) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Waypoint
Returns a new instance of Waypoint.
8 9 10 11 |
# File 'lib/seametrix_ruby/models/waypoint.rb', line 8 def initialize(attributes = {}) @lon = attributes[:lon].to_f @lat = attributes[:lat].to_f end |
Instance Attribute Details
#lat ⇒ Object
Returns the value of attribute lat.
6 7 8 |
# File 'lib/seametrix_ruby/models/waypoint.rb', line 6 def lat @lat end |
#lon ⇒ Object
Returns the value of attribute lon.
6 7 8 |
# File 'lib/seametrix_ruby/models/waypoint.rb', line 6 def lon @lon end |
Class Method Details
.from_json(json_string) ⇒ Object
13 14 15 16 17 |
# File 'lib/seametrix_ruby/models/waypoint.rb', line 13 def self.from_json(json_string) json = MultiJson.load(json_string) new(lon: json['lon'].to_f, lat: json['lat'].to_f) end |
Instance Method Details
#latitude ⇒ Object
19 20 21 |
# File 'lib/seametrix_ruby/models/waypoint.rb', line 19 def latitude lat end |
#latitude=(value) ⇒ Object
27 28 29 |
# File 'lib/seametrix_ruby/models/waypoint.rb', line 27 def latitude=(value) @lat = value.to_f end |
#longitude ⇒ Object
23 24 25 |
# File 'lib/seametrix_ruby/models/waypoint.rb', line 23 def longitude lon end |
#longitude=(value) ⇒ Object
31 32 33 |
# File 'lib/seametrix_ruby/models/waypoint.rb', line 31 def longitude=(value) @lon = value.to_f end |