Class: ParseGeoPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/parse_resource/types/parse_geopoint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#latitudeObject

Returns the value of attribute latitude.



2
3
4
# File 'lib/parse_resource/types/parse_geopoint.rb', line 2

def latitude
  @latitude
end

#longitudeObject

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_pointerObject



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