Method: Upwords::Shape#initialize
- Defined in:
- lib/upwords/shape.rb
#initialize(positions = []) ⇒ Shape
Returns a new instance of Shape.
9 10 11 12 |
# File 'lib/upwords/shape.rb', line 9 def initialize(positions = []) @positions = Set.new positions.reduce(self) {|shape, (row, col)| shape.add(row, col)} end |