Class: CartoJson::Circle
Instance Attribute Summary collapse
-
#radius ⇒ Object
Returns the value of attribute radius.
Instance Method Summary collapse
Methods inherited from Point
#==, #initialize, #to_hash_for_array
Methods included from Shape
included, #initialize, #to_json, #to_pretty_json, #to_s, #type
Constructor Details
This class inherits a constructor from CartoJson::Point
Instance Attribute Details
#radius ⇒ Object
Returns the value of attribute radius.
5 6 7 |
# File 'lib/carto_json/circle.rb', line 5 def radius @radius end |
Instance Method Details
#to_hash ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/carto_json/circle.rb', line 24 def to_hash {:type => self.class.type, LAT => send(LAT), LNG => send(LNG), :radius => radius } end |
#to_point ⇒ Object
20 21 22 |
# File 'lib/carto_json/circle.rb', line 20 def to_point Point.new LAT => send(LAT), LNG => send(LNG) end |
#to_wkt ⇒ Object
16 17 18 |
# File 'lib/carto_json/circle.rb', line 16 def to_wkt raise NotImplementedError, 'WKT does not support circles directly, conversion to polygon is required' end |