Class: CloudMade::MultiPolygon
Instance Attribute Summary collapse
-
#polygons ⇒ Object
Returns the value of attribute polygons.
Instance Method Summary collapse
-
#initialize(coords) ⇒ MultiPolygon
constructor
A new instance of MultiPolygon.
- #to_s ⇒ Object
Methods inherited from Geometry
Constructor Details
#initialize(coords) ⇒ MultiPolygon
Returns a new instance of MultiPolygon.
106 107 108 |
# File 'lib/geometry.rb', line 106 def initialize(coords) @polygons = coords.map { |poly_coords| Polygon.new(poly_coords) } end |
Instance Attribute Details
#polygons ⇒ Object
Returns the value of attribute polygons.
104 105 106 |
# File 'lib/geometry.rb', line 104 def polygons @polygons end |
Instance Method Details
#to_s ⇒ Object
110 111 112 |
# File 'lib/geometry.rb', line 110 def to_s "MultiPolygon(#{@polygons.join(',')})" end |