class Client

Public Class Methods

new() click to toggle source
# File lib/another_toy_robot/client.rb, line 5
def initialize
  @robot = Robot.new
  @table = Arena.new width: 5, height: 5

  @robot.arena = @table
end

Public Instance Methods

command_for(input) click to toggle source
# File lib/another_toy_robot/client.rb, line 12
def command_for(input)
  klass   = input.to_class
  params  = input.params
  command = klass.new target: @robot, params: params

  command.execute
end