Class: MeshChat::Command::Base

Inherits:
MeshChat::CLI::Input show all
Defined in:
lib/meshchat/command/base.rb

Constant Summary collapse

SET =

Commands

'set'
CONFIG =
'config'
DISPLAY =
'display'
EXIT =
'exit'
QUIT =
'quit'
LISTEN =
'listen'
STOP_LISTENING =
'stoplistening'
CONNECT =
'connect'
CHAT =
'chat'
ADD =
'add'
REMOVE =
'remove'
RM =
'rm'
SERVERS =
'servers'
SERVER =
'server'
WHO =
'who'
PING =
'ping'
PING_ALL =
'pingall'
IDENTITY =
'identity'
IRB =
'c'
INIT =
'init'
SHARE =
'share'
IMPORT =
'import'
EXPORT =
'export'

Constants inherited from MeshChat::CLI::Input

MeshChat::CLI::Input::COMMAND, MeshChat::CLI::Input::WHISPER

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MeshChat::CLI::Input

create, #initialize, is_command?, is_whisper?

Constructor Details

This class inherits a constructor from MeshChat::CLI::Input

Instance Attribute Details

#_inputObject

Returns the value of attribute _input.



4
5
6
# File 'lib/meshchat/command/base.rb', line 4

def _input
  @_input
end

Instance Method Details

#handleObject



31
32
33
34
35
36
37
38
# File 'lib/meshchat/command/base.rb', line 31

def handle
  klass = CLI::COMMAND_MAP[command]
  if klass
    klass.new(_input).handle
  else
    Display.alert 'not implemented...'
  end
end