Class: MeshChat::Command::Server

Inherits:
Base show all
Defined in:
lib/meshchat/command/server.rb

Constant Summary collapse

ONLINE =
'online'

Constants inherited from Base

Base::ADD, Base::CHAT, Base::CONFIG, Base::CONNECT, Base::DISPLAY, Base::EXIT, Base::EXPORT, Base::IDENTITY, Base::IMPORT, Base::INIT, Base::IRB, Base::LISTEN, Base::PING, Base::PING_ALL, Base::QUIT, Base::REMOVE, Base::RM, Base::SERVER, Base::SERVERS, Base::SET, Base::SHARE, Base::STOP_LISTENING, Base::WHO

Constants inherited from MeshChat::CLI::Input

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

Instance Attribute Summary

Attributes inherited from Base

#_input

Attributes inherited from MeshChat::CLI::Input

#_input

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 Method Details

#handleObject



6
7
8
9
10
11
12
13
# File 'lib/meshchat/command/server.rb', line 6

def handle
  case sub_command
  when ONLINE
    Display.info Node.online.map(&:as_info).join(', ') || 'no one is online'
  else
    Display.info Node.all.map(&:as_info).join(', ') || 'there are no nodes'
  end
end