Class: Atoyrobot::Commands::Place
- Defined in:
- lib/atoyrobot/commands/place.rb
Instance Method Summary collapse
- #execute(robot) ⇒ Object
-
#initialize(*args) ⇒ Place
constructor
A new instance of Place.
Methods inherited from Base
Constructor Details
#initialize(*args) ⇒ Place
Returns a new instance of Place.
14 15 16 17 |
# File 'lib/atoyrobot/commands/place.rb', line 14 def initialize(*args) super @location = Location.new(x, y, facing) end |
Instance Method Details
#execute(robot) ⇒ Object
19 20 21 |
# File 'lib/atoyrobot/commands/place.rb', line 19 def execute(robot) robot.place(@location.x, @location.y, @location.facing) end |