Class: Model::Tile
- Inherits:
-
Object
- Object
- Model::Tile
- Defined in:
- lib/tic_tac_toe/model/tile.rb
Instance Attribute Summary collapse
-
#col ⇒ Object
Returns the value of attribute col.
-
#piece ⇒ Object
Returns the value of attribute piece.
-
#row ⇒ Object
Returns the value of attribute row.
Instance Method Summary collapse
Instance Attribute Details
#col ⇒ Object
Returns the value of attribute col.
3 4 5 |
# File 'lib/tic_tac_toe/model/tile.rb', line 3 def col @col end |
#piece ⇒ Object
Returns the value of attribute piece.
3 4 5 |
# File 'lib/tic_tac_toe/model/tile.rb', line 3 def piece @piece end |
#row ⇒ Object
Returns the value of attribute row.
3 4 5 |
# File 'lib/tic_tac_toe/model/tile.rb', line 3 def row @row end |
Instance Method Details
#available? ⇒ Boolean
5 6 7 |
# File 'lib/tic_tac_toe/model/tile.rb', line 5 def available? piece.nil? end |
#piece_name ⇒ Object
13 14 15 |
# File 'lib/tic_tac_toe/model/tile.rb', line 13 def piece_name piece ? piece.name : '-' end |
#team ⇒ Object
9 10 11 |
# File 'lib/tic_tac_toe/model/tile.rb', line 9 def team piece&.team end |