Class: Cell
- Inherits:
-
Object
- Object
- Cell
- Defined in:
- lib/fiveinarow/cell.rb
Constant Summary collapse
- EMPTY =
0
- PLAYER_A =
1
- PLAYER_B =
2
Instance Attribute Summary collapse
-
#col ⇒ Object
readonly
Returns the value of attribute col.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #a? ⇒ Boolean
- #b? ⇒ Boolean
- #e? ⇒ Boolean
-
#initialize(row, col, val) ⇒ Cell
constructor
A new instance of Cell.
- #set(v) ⇒ Object
Constructor Details
#initialize(row, col, val) ⇒ Cell
Returns a new instance of Cell.
10 11 12 13 14 |
# File 'lib/fiveinarow/cell.rb', line 10 def initialize(row, col, val) @row = row @col = col @value = val end |
Instance Attribute Details
#col ⇒ Object (readonly)
Returns the value of attribute col.
4 5 6 |
# File 'lib/fiveinarow/cell.rb', line 4 def col @col end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
3 4 5 |
# File 'lib/fiveinarow/cell.rb', line 3 def row @row end |
#value ⇒ Object
Returns the value of attribute value.
2 3 4 |
# File 'lib/fiveinarow/cell.rb', line 2 def value @value end |
Instance Method Details
#set(v) ⇒ Object
16 17 18 |
# File 'lib/fiveinarow/cell.rb', line 16 def set(v) @value = v end |