Class: KakaxiParse::Datatype::GeoPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/kakaxi_parse/datatypes/geopoint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#latObject

Returns the value of attribute lat.



4
5
6
# File 'lib/kakaxi_parse/datatypes/geopoint.rb', line 4

def lat
  @lat
end

#lonObject

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_hashObject



11
12
13
# File 'lib/kakaxi_parse/datatypes/geopoint.rb', line 11

def to_hash
  { __type: 'GeoPoint', latitude: @lat, longitude: @lon }
end