class Robotoy::Table

Attributes

x[R]
y[R]

Public Class Methods

new(x: 4, y: 4) click to toggle source
# File lib/robotoy/table.rb, line 5
def initialize(x: 4, y: 4)
  @x = x
  @y = y
end

Public Instance Methods

validate_next_position(x: 0, y: 0) click to toggle source
# File lib/robotoy/table.rb, line 10
def validate_next_position(x: 0, y: 0)
  raise NotValidMoveError unless x.between?(0, @x) && y.between?(0, @y)
end