lib/ncmb/geo_point.rb in ncmb-ruby-client-0.0.9 vs lib/ncmb/geo_point.rb in ncmb-ruby-client-0.1.0
- old
+ new
@@ -6,10 +6,14 @@
@latitude = latitude
@longitude = longitude
end
def to_json(a = "")
- "{\"__type\": \"GeoPoint\", \"longitude\": #{@longitude}, \"latitude\": #{@latitude}}"
+ {
+ "__type": "GeoPoint",
+ "longitude": @longitude,
+ "latitude": @latitude
+ }.to_json
end
def to_s
"GeoPoint (latitude: #{@latitude}, longitude: #{@longitude})"
end
\ No newline at end of file