Class: RbSnake::Models::Coordinate
- Inherits:
-
Object
- Object
- RbSnake::Models::Coordinate
- Defined in:
- lib/rb_snake/models/coordinate.rb
Instance Attribute Summary collapse
-
#col ⇒ Object
Returns the value of attribute col.
-
#row ⇒ Object
Returns the value of attribute row.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
-
#initialize(row:, col:) ⇒ Coordinate
constructor
A new instance of Coordinate.
Constructor Details
#initialize(row:, col:) ⇒ Coordinate
Returns a new instance of Coordinate.
8 9 10 11 |
# File 'lib/rb_snake/models/coordinate.rb', line 8 def initialize(row:, col:) @row = row @col = col end |
Instance Attribute Details
#col ⇒ Object
Returns the value of attribute col.
6 7 8 |
# File 'lib/rb_snake/models/coordinate.rb', line 6 def col @col end |
#row ⇒ Object
Returns the value of attribute row.
6 7 8 |
# File 'lib/rb_snake/models/coordinate.rb', line 6 def row @row end |
Instance Method Details
#eql?(other) ⇒ Boolean
13 14 15 |
# File 'lib/rb_snake/models/coordinate.rb', line 13 def eql?(other) row == other.row && col == other.col end |