Class: Parse::GeoPoint
Instance Attribute Summary collapse
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ GeoPoint
constructor
A new instance of GeoPoint.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Methods included from Util
Constructor Details
#initialize(hash = {}) ⇒ GeoPoint
Returns a new instance of GeoPoint.
8 9 10 11 12 |
# File 'lib/parse/geo_point.rb', line 8 def initialize hash={} hash = string_keyed_hash hash @latitude = hash['latitude'] @longitude = hash['longitude'] end |
Instance Attribute Details
#latitude ⇒ Object
Returns the value of attribute latitude.
6 7 8 |
# File 'lib/parse/geo_point.rb', line 6 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
6 7 8 |
# File 'lib/parse/geo_point.rb', line 6 def longitude @longitude end |
Instance Method Details
#to_h ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/parse/geo_point.rb', line 14 def to_h { "__type" => "GeoPoint", "latitude" => @latitude, "longitude" => @longitude } end |
#to_json(*args) ⇒ Object
22 23 24 |
# File 'lib/parse/geo_point.rb', line 22 def to_json *args to_h.to_json end |