Class: FEEN::Parser::Shape
- Inherits:
-
Object
- Object
- FEEN::Parser::Shape
- Defined in:
- lib/feen/parser/shape.rb
Overview
The shape class.
Instance Method Summary collapse
-
#initialize(board) ⇒ Shape
constructor
A new instance of Shape.
-
#to_a ⇒ Array
The size of each dimension of the board.
Constructor Details
#initialize(board) ⇒ Shape
Returns a new instance of Shape.
11 12 13 |
# File 'lib/feen/parser/shape.rb', line 11 def initialize(board) @board = board end |
Instance Method Details
#to_a ⇒ Array
Returns The size of each dimension of the board.
16 17 18 |
# File 'lib/feen/parser/shape.rb', line 16 def to_a indexes(@board, @board.scan(%r{/+}).sort.fetch(-1)) end |