Class: CloudMade::Polygon
Instance Attribute Summary collapse
-
#border_line ⇒ Object
Returns the value of attribute border_line.
-
#holes ⇒ Object
Returns the value of attribute holes.
Instance Method Summary collapse
-
#initialize(coords) ⇒ Polygon
constructor
A new instance of Polygon.
- #to_s ⇒ Object
Methods inherited from Geometry
Constructor Details
#initialize(coords) ⇒ Polygon
Returns a new instance of Polygon.
93 94 95 96 |
# File 'lib/geometry.rb', line 93 def initialize(coords) @border_line = Line.new(coords[0]) @holes = coords.slice(1, coords.length).map { |line_coords| Line.new(line_coords) } end |
Instance Attribute Details
#border_line ⇒ Object
Returns the value of attribute border_line.
90 91 92 |
# File 'lib/geometry.rb', line 90 def border_line @border_line end |
#holes ⇒ Object
Returns the value of attribute holes.
91 92 93 |
# File 'lib/geometry.rb', line 91 def holes @holes end |
Instance Method Details
#to_s ⇒ Object
98 99 100 |
# File 'lib/geometry.rb', line 98 def to_s "Polygon(#{@border_line} - (#{@holes.join(',')}))" end |