Class: Robot::Simulator::Coordinate

Inherits:
Object
  • Object
show all
Defined in:
lib/robot/simulator/coordinate.rb

Overview

Coordinate on the table, starting from (0, 0) on south west corner.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y) ⇒ Coordinate

Returns a new instance of Coordinate.



7
8
9
# File 'lib/robot/simulator/coordinate.rb', line 7

def initialize(x, y)
  @x, @y = x, y
end

Instance Attribute Details

#xObject (readonly)

Returns the value of attribute x.



5
6
7
# File 'lib/robot/simulator/coordinate.rb', line 5

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



5
6
7
# File 'lib/robot/simulator/coordinate.rb', line 5

def y
  @y
end