Class: FEEN::Dumper::Square
- Inherits:
-
Object
- Object
- FEEN::Dumper::Square
- Defined in:
- lib/feen/dumper/square.rb
Overview
The square class.
Instance Method Summary collapse
-
#initialize(indexes, board) ⇒ Square
constructor
A new instance of Square.
-
#to_s ⇒ String
The string representing the board.
Constructor Details
#initialize(indexes, board) ⇒ Square
Returns a new instance of Square.
51 52 53 54 |
# File 'lib/feen/dumper/square.rb', line 51 def initialize(indexes, board) @indexes = indexes @squares = Array.new(length) { |i| board.fetch(i, nil) } end |
Instance Method Details
#to_s ⇒ String
Returns The string representing the board.
57 58 59 |
# File 'lib/feen/dumper/square.rb', line 57 def to_s unflatten(@squares, @indexes) end |