Class: Move
- Inherits:
-
Object
- Object
- Move
- Defined in:
- lib/board.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#player_value ⇒ Object
readonly
Returns the value of attribute player_value.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(row, column, player_value = 1) ⇒ Move
constructor
A new instance of Move.
Constructor Details
#initialize(row, column, player_value = 1) ⇒ Move
Returns a new instance of Move.
84 85 86 |
# File 'lib/board.rb', line 84 def initialize(row,column, player_value = 1) @row, @column, @player_value = row, column, player_value end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
82 83 84 |
# File 'lib/board.rb', line 82 def column @column end |
#player_value ⇒ Object (readonly)
Returns the value of attribute player_value.
82 83 84 |
# File 'lib/board.rb', line 82 def player_value @player_value end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
82 83 84 |
# File 'lib/board.rb', line 82 def row @row end |
Instance Method Details
#==(other) ⇒ Object
88 89 90 |
# File 'lib/board.rb', line 88 def ==(other) return other.is_a?(Move) && self.row == other.row && self.column == other.column end |