class Command::UserDefined
Attributes
name[R]
Public Class Methods
new(name)
click to toggle source
# File lib/karel/command/user_defined.rb, line 7 def initialize(name) @name = name @statements = [] end
Public Instance Methods
add_statement(statement)
click to toggle source
# File lib/karel/command/user_defined.rb, line 12 def add_statement(statement) @statements << statement end
execute(compass, location, tokens)
click to toggle source
# File lib/karel/command/user_defined.rb, line 16 def execute(compass, location, tokens) Batch.new(@statements).execute(compass, location, tokens) end