Sha256: 7258ab983ae3f985a13e2e407a45abaf5171570a1795ec7e744b87e9c4a76533

Contents?: true

Size: 412 Bytes

Versions: 4

Compression:

Stored size: 412 Bytes

Contents

module NCMB
  class GeoPoint
    include NCMB
    
    def initialize(latitude, longitude)
      @latitude = latitude
      @longitude = longitude
    end
    
    def to_json(a = "")
      {
        "__type": "GeoPoint",
        "longitude": @longitude,
        "latitude": @latitude
      }.to_json
    end
    
    def to_s
      "GeoPoint (latitude: #{@latitude}, longitude: #{@longitude})"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ncmb-ruby-client-0.1.3 lib/ncmb/geo_point.rb
ncmb-ruby-client-0.1.2 lib/ncmb/geo_point.rb
ncmb-ruby-client-0.1.1 lib/ncmb/geo_point.rb
ncmb-ruby-client-0.1.0 lib/ncmb/geo_point.rb