Sha256: 3e3b108e71ca3ae7378e99fff5ff109cc3a11fc850aa59fc76d5ae95aea5cb43

Contents?: true

Size: 407 Bytes

Versions: 1

Compression:

Stored size: 407 Bytes

Contents

class ParseGeoPoint
  attr_accessor :latitude, :longitude

  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

  def to_pointer
    {"__type"=>"GeoPoint", :latitude=> self.latitude, :longitude => self.longitude}
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parse_resource-1.8.0 lib/parse_resource/types/parse_geopoint.rb