Class: Move

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#columnObject (readonly)

Returns the value of attribute column.



82
83
84
# File 'lib/board.rb', line 82

def column
  @column
end

#player_valueObject (readonly)

Returns the value of attribute player_value.



82
83
84
# File 'lib/board.rb', line 82

def player_value
  @player_value
end

#rowObject (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