Class: NCMB::GeoPoint
Constant Summary
Constants included from NCMB
API_VERSION, DOMAIN, SCRIPT_API_VERSION, SCRIPT_DOMAIN
Instance Method Summary collapse
-
#initialize(latitude, longitude) ⇒ GeoPoint
constructor
A new instance of GeoPoint.
- #to_json(a = '') ⇒ Object
- #to_s ⇒ Object
Methods included from NCMB
Constructor Details
#initialize(latitude, longitude) ⇒ GeoPoint
Returns a new instance of GeoPoint.
7 8 9 10 |
# File 'lib/ncmb/geo_point.rb', line 7 def initialize(latitude, longitude) @latitude = latitude @longitude = longitude end |
Instance Method Details
#to_json(a = '') ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/ncmb/geo_point.rb', line 12 def to_json(a = '') { '__type': 'GeoPoint', 'longitude': @longitude, 'latitude': @latitude }.to_json end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/ncmb/geo_point.rb', line 20 def to_s "GeoPoint (latitude: #{@latitude}, longitude: #{@longitude})" end |