Class: Point
- Inherits:
-
Object
- Object
- Point
- Defined in:
- lib/my_own_maze/model/point.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y) ⇒ Point
constructor
A new instance of Point.
- #set_position(x, y) ⇒ Object
Constructor Details
#initialize(x, y) ⇒ Point
Returns a new instance of Point.
4 5 6 7 |
# File 'lib/my_own_maze/model/point.rb', line 4 def initialize(x, y) @x = x @y = y end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
2 3 4 |
# File 'lib/my_own_maze/model/point.rb', line 2 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
2 3 4 |
# File 'lib/my_own_maze/model/point.rb', line 2 def y @y end |
Instance Method Details
#set_position(x, y) ⇒ Object
9 10 11 |
# File 'lib/my_own_maze/model/point.rb', line 9 def set_position(x, y) @x, @y = x, y end |