class PBM::Interpreter
Attributes
commands[RW]
running[W]
Public Class Methods
load()
click to toggle source
# File lib/pbm/interpreter.rb, line 6 def load self.new.tap do |interpreter| interpreter.commands = AllCommands.load(interpreter) end end
new()
click to toggle source
# File lib/pbm/interpreter.rb, line 16 def initialize @running = true end
Public Instance Methods
exec(command)
click to toggle source
# File lib/pbm/interpreter.rb, line 20 def exec command command = command.to_sym raise "#{command}: invalid command." unless @commands.has_key?(command) @commands[command].run end
running?()
click to toggle source
# File lib/pbm/interpreter.rb, line 26 def running? !!@running end