Class: Checkers::Move
- Inherits:
-
Object
- Object
- Checkers::Move
- Defined in:
- lib/checkers/move.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#end_square ⇒ Object
readonly
Returns the value of attribute end_square.
-
#start_square ⇒ Object
readonly
Returns the value of attribute start_square.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(start_square, end_square) ⇒ Move
constructor
A new instance of Move.
Constructor Details
#initialize(start_square, end_square) ⇒ Move
Returns a new instance of Move.
7 8 9 10 |
# File 'lib/checkers/move.rb', line 7 def initialize(start_square, end_square) @start_square = start_square @end_square = end_square end |
Instance Attribute Details
#end_square ⇒ Object (readonly)
Returns the value of attribute end_square.
5 6 7 |
# File 'lib/checkers/move.rb', line 5 def end_square @end_square end |
#start_square ⇒ Object (readonly)
Returns the value of attribute start_square.
5 6 7 |
# File 'lib/checkers/move.rb', line 5 def start_square @start_square end |
Instance Method Details
#==(other) ⇒ Object
12 13 14 |
# File 'lib/checkers/move.rb', line 12 def ==(other) start_square == other.start_square && end_square == other.end_square end |