Class: ToyRoboSimulator::Table
- Inherits:
-
Object
- Object
- ToyRoboSimulator::Table
- Defined in:
- lib/toy_robo_simulator/table.rb
Overview
Table is the environment in the program which decides the length and width of the table. The table will be used to validate the placement and movement of a Robo.
The attributes x and y are the maximum values of length and width, while 0 is the minimum value.
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
-
#initialize(x, y) ⇒ Table
constructor
A new instance of Table.
Constructor Details
#initialize(x, y) ⇒ Table
Returns a new instance of Table.
10 11 12 13 |
# File 'lib/toy_robo_simulator/table.rb', line 10 def initialize(x, y) @x = x @y = y end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
9 10 11 |
# File 'lib/toy_robo_simulator/table.rb', line 9 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
9 10 11 |
# File 'lib/toy_robo_simulator/table.rb', line 9 def y @y end |