class Command::Not

Public Class Methods

new(statement) click to toggle source
# File lib/karel/command/not.rb, line 5
def initialize(statement)
  @statement = statement
end

Public Instance Methods

execute(compass, location, tokens) click to toggle source
# File lib/karel/command/not.rb, line 9
def execute(compass, location, tokens)
  response = @statement.execute(compass, location, tokens)
  Response.new(
    compass: response.compass,
    location: response.location,
    operations_count: response.operations_count,
    return_value: !response.return_value,
    tokens: response.tokens
  )
end