Class: ToyRoboSimulator::Table

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#xObject (readonly)

Returns the value of attribute x.



9
10
11
# File 'lib/toy_robo_simulator/table.rb', line 9

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



9
10
11
# File 'lib/toy_robo_simulator/table.rb', line 9

def y
  @y
end