Class: TresRaya::Board::Row
- Inherits:
-
Object
- Object
- TresRaya::Board::Row
- Includes:
- SquaresContainer
- Defined in:
- lib/tres_raya/board.rb
Instance Attribute Summary collapse
-
#names ⇒ Object
readonly
Returns the value of attribute names.
-
#squares ⇒ Object
readonly
Returns the value of attribute squares.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(squares, names) ⇒ Row
constructor
A new instance of Row.
- #to_board_name(index) ⇒ Object
Methods included from SquaresContainer
Constructor Details
#initialize(squares, names) ⇒ Row
Returns a new instance of Row.
10 11 12 13 |
# File 'lib/tres_raya/board.rb', line 10 def initialize( squares, names ) @squares = squares @names = names end |
Instance Attribute Details
#names ⇒ Object (readonly)
Returns the value of attribute names.
8 9 10 |
# File 'lib/tres_raya/board.rb', line 8 def names @names end |
#squares ⇒ Object (readonly)
Returns the value of attribute squares.
8 9 10 |
# File 'lib/tres_raya/board.rb', line 8 def squares @squares end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 |
# File 'lib/tres_raya/board.rb', line 21 def ==(other) (@squares == other.squares) && (@names == other.names) end |
#to_board_name(index) ⇒ Object
17 18 19 |
# File 'lib/tres_raya/board.rb', line 17 def to_board_name( index ) Board.index_to_name(@names[index]) end |