class Robot::Commands::Place
Place
Command
Constants
- REGEX
Public Class Methods
build_from_string_command(command)
click to toggle source
# File lib/robot/commands/place.rb, line 20 def self.build_from_string_command(command) x, y, f = parse(command) x = x.to_i y = y.to_i f = f.to_sym call(x: x, y: y, f: f) end
call(x:, y:, f:)
click to toggle source
# File lib/robot/commands/place.rb, line 16 def self.call(x:, y:, f:) Robot::Position.new(point: Point.new(x: x, y: y), direction: f) end
matches?(command)
click to toggle source
# File lib/robot/commands/place.rb, line 12 def self.matches?(command) command =~ REGEX end