Sha256: 9a9b41b9222953f46fe037a94ee8786ab41571fb4dc0fe677abb26a72477b68d

Contents?: true

Size: 358 Bytes

Versions: 2

Compression:

Stored size: 358 Bytes

Contents

require_relative 'batch'

module Command
  class UserDefined
    attr_reader :name

    def initialize(name)
      @name = name
      @statements = []
    end

    def add_statement(statement)
      @statements << statement
    end

    def execute(compass, location, tokens)
      Batch.new(@statements).execute(compass, location, tokens)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
karel-interpreter-0.2.0 lib/karel/command/user_defined.rb
karel-interpreter-0.1.0 lib/karel/command/user_defined.rb