Module: Rex::Ui::Text::DispatcherShell::CommandDispatcher::ClassMethods

Defined in:
lib/rex/ui/text/dispatcher_shell.rb

Instance Method Summary collapse

Instance Method Details

#has_command?(name) ⇒ Boolean

Check whether or not the command dispatcher is capable of handling the specified command. The command may still be disabled through some means at runtime.

Parameters:

  • name (String)

    The name of the command to check.

Returns:

  • (Boolean)

    true if the dispatcher can handle the command.



39
40
41
# File 'lib/rex/ui/text/dispatcher_shell.rb', line 39

def has_command?(name)
  self.method_defined?("cmd_#{name}")
end

#included(base) ⇒ Object



43
44
45
46
# File 'lib/rex/ui/text/dispatcher_shell.rb', line 43

def included(base)
  # Propagate the included hook
  CommandDispatcher.included(base)
end