Class: ParseGeoPoint
- Inherits:
-
Object
- Object
- ParseGeoPoint
- Defined in:
- lib/parse_resource/types/parse_geopoint.rb
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 = nil) ⇒ ParseGeoPoint
constructor
A new instance of ParseGeoPoint.
- #to_pointer ⇒ Object
Constructor Details
#initialize(hash = nil) ⇒ ParseGeoPoint
Returns a new instance of ParseGeoPoint.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/parse_resource/types/parse_geopoint.rb', line 4 def initialize(hash=nil) if hash.nil? self.latitude=0.0 self.longitude=0.0 else self.latitude = hash["latitude"] || hash[:latitude] self.longitude = hash["longitude"] || hash[:longitude] end end |
Instance Attribute Details
#latitude ⇒ Object
Returns the value of attribute latitude.
2 3 4 |
# File 'lib/parse_resource/types/parse_geopoint.rb', line 2 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
2 3 4 |
# File 'lib/parse_resource/types/parse_geopoint.rb', line 2 def longitude @longitude end |
Instance Method Details
#to_pointer ⇒ Object
15 16 17 |
# File 'lib/parse_resource/types/parse_geopoint.rb', line 15 def to_pointer {"__type"=>"GeoPoint", :latitude=> self.latitude, :longitude => self.longitude} end |