Class: TicTacToe::Cell
- Inherits:
-
Object
- Object
- TicTacToe::Cell
- Defined in:
- lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/cell.rb
Constant Summary collapse
- EMPTY =
""
Instance Attribute Summary collapse
-
#empty ⇒ Object
Returns the value of attribute empty.
-
#sign ⇒ Object
Returns the value of attribute sign.
Instance Method Summary collapse
-
#initialize ⇒ Cell
constructor
A new instance of Cell.
- #mark(sign) ⇒ Object
- #marked ⇒ Object
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Cell
Returns a new instance of Cell.
6 7 8 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/cell.rb', line 6 def initialize reset end |
Instance Attribute Details
#empty ⇒ Object
Returns the value of attribute empty.
4 5 6 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/cell.rb', line 4 def empty @empty end |
#sign ⇒ Object
Returns the value of attribute sign.
4 5 6 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/cell.rb', line 4 def sign @sign end |
Instance Method Details
#mark(sign) ⇒ Object
10 11 12 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/cell.rb', line 10 def mark(sign) self.sign = sign end |
#marked ⇒ Object
23 24 25 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/cell.rb', line 23 def marked !empty end |
#reset ⇒ Object
14 15 16 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe/cell.rb', line 14 def reset self.sign = EMPTY end |