Class: PlaceCommand
- Inherits:
-
Command
show all
- Defined in:
- lib/another_toy_robot/place_command.rb
Instance Attribute Summary
Attributes inherited from Command
#params, #target
Instance Method Summary
collapse
Methods inherited from Command
#execute, #initialize
Constructor Details
This class inherits a constructor from Command
Instance Method Details
#issue_command ⇒ Object
8
9
10
11
12
|
# File 'lib/another_toy_robot/place_command.rb', line 8
def issue_command
@target.place Position.new(x_coord: x_coord,
y_coord: y_coord,
direction: direction)
end
|
#post_initialize ⇒ Object
4
5
6
|
# File 'lib/another_toy_robot/place_command.rb', line 4
def post_initialize
@params &&= @params.join.delete(" ").split ","
end
|