module Gyunyu::Command

Public Class Methods

app_const( command ) click to toggle source
# File lib/gyunyu/command.rb, line 17
def self.app_const( command )
  Gyunyu::Command.const_get(command.capitalize).const_get('App')
end
commands() click to toggle source
# File lib/gyunyu/command.rb, line 5
def self.commands
  constants.map { |e| e.to_s.downcase }
end
dispatch( command ) click to toggle source
# File lib/gyunyu/command.rb, line 9
def self.dispatch( command )
  if commands.include?( command )
    app_const( command ).new.run
  else
    raise NotFound, command
  end
end