Class: AsciiTree::Coordinate
- Inherits:
-
Object
- Object
- AsciiTree::Coordinate
- Defined in:
- lib/ascii_tree/coordinate.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(x:, y:) ⇒ Coordinate
constructor
A new instance of Coordinate.
Constructor Details
#initialize(x:, y:) ⇒ Coordinate
Returns a new instance of Coordinate.
5 6 7 8 |
# File 'lib/ascii_tree/coordinate.rb', line 5 def initialize(x:, y:) @x = x @y = y end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
3 4 5 |
# File 'lib/ascii_tree/coordinate.rb', line 3 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
3 4 5 |
# File 'lib/ascii_tree/coordinate.rb', line 3 def y @y end |
Instance Method Details
#==(other) ⇒ Object
10 11 12 |
# File 'lib/ascii_tree/coordinate.rb', line 10 def ==(other) x == other.x && y == other.y end |