Sha256: 38cfea6110c76a584a6d377f26458d15ca9146b1e01e3e7e505654efb2a93982

Contents?: true

Size: 443 Bytes

Versions: 5

Compression:

Stored size: 443 Bytes

Contents

# frozen_string_literal: true

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

5 entries across 5 versions & 1 rubygems

Version Path
ncmb-ruby-client-0.2.0 lib/ncmb/geo_point.rb
ncmb-ruby-client-0.1.7 lib/ncmb/geo_point.rb
ncmb-ruby-client-0.1.6 lib/ncmb/geo_point.rb
ncmb-ruby-client-0.1.5 lib/ncmb/geo_point.rb
ncmb-ruby-client-0.1.4 lib/ncmb/geo_point.rb