Class: LocoBot::CLI::Command::Place
- Defined in:
- lib/loco_bot/cli/command/place.rb
Overview
Upon execution, calls #place on the robot attribute.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#execute(x, y, direction_name) ⇒ Boolean
Executes the command.
Methods inherited from Base
Constructor Details
This class inherits a constructor from LocoBot::CLI::Command::Base
Instance Method Details
#execute(x, y, direction_name) ⇒ Boolean
Executes the command. Calls #place on the robot attribute, passing the table attribute and the given arguments.
9 10 11 12 13 |
# File 'lib/loco_bot/cli/command/place.rb', line 9 def execute(x, y, direction_name) direction = Robot::Direction.from_name(direction_name) robot.place(table, x.to_i, y.to_i, direction) end |