Class: Checkers::Move

Inherits:
Object
  • Object
show all
Defined in:
lib/checkers/move.rb

Direct Known Subclasses

JumpMove

Instance Attribute Summary collapse

Instance Method Summary collapse

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_squareObject (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_squareObject (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