Method: Commands.interpret

Defined in:
lib/gdsh/commands.rb

.interpret(input) ⇒ Object



43
44
45
46
47
48
49
50
51
52
# File 'lib/gdsh/commands.rb', line 43

def interpret(input)
  return Quit if input.nil?

  commands.each do |c|
    klass = const_get(c)
    return klass if input == klass.command_name
  end

  Unrecognized
end