Class: KakaxiParse::Datatype::GeoPoint
- Inherits:
-
Object
- Object
- KakaxiParse::Datatype::GeoPoint
- Defined in:
- lib/kakaxi_parse/datatypes/geopoint.rb
Instance Attribute Summary collapse
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#lon ⇒ Object
Returns the value of attribute lon.
Instance Method Summary collapse
-
#initialize(lat = nil, lon = nil) ⇒ GeoPoint
constructor
A new instance of GeoPoint.
- #to_hash ⇒ Object
Constructor Details
#initialize(lat = nil, lon = nil) ⇒ GeoPoint
Returns a new instance of GeoPoint.
6 7 8 9 |
# File 'lib/kakaxi_parse/datatypes/geopoint.rb', line 6 def initialize(lat=nil, lon=nil) @lat = lat.to_f @lon = lon.to_f end |
Instance Attribute Details
#lat ⇒ Object
Returns the value of attribute lat.
4 5 6 |
# File 'lib/kakaxi_parse/datatypes/geopoint.rb', line 4 def lat @lat end |
#lon ⇒ Object
Returns the value of attribute lon.
4 5 6 |
# File 'lib/kakaxi_parse/datatypes/geopoint.rb', line 4 def lon @lon end |
Instance Method Details
#to_hash ⇒ Object
11 12 13 |
# File 'lib/kakaxi_parse/datatypes/geopoint.rb', line 11 def to_hash { __type: 'GeoPoint', latitude: @lat, longitude: @lon } end |