Class: Shared::Point
- Inherits:
-
Struct
- Object
- Struct
- Shared::Point
- Defined in:
- lib/data_structures_rmolinari/shared.rb
Overview
An (x, y) coordinate pair.
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x
7 8 9 |
# File 'lib/data_structures_rmolinari/shared.rb', line 7 def x @x end |
#y ⇒ Object
Returns the value of attribute y
7 8 9 |
# File 'lib/data_structures_rmolinari/shared.rb', line 7 def y @y end |
Instance Method Details
#to_s ⇒ Object
8 9 10 |
# File 'lib/data_structures_rmolinari/shared.rb', line 8 def to_s "[#{x}, #{y}]" end |