Class: Meshchat::Ui::Command::Server

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

Constant Summary collapse

ONLINE =
'online'

Constants inherited from Base

Base::ADD, Base::ALL_CHAT_LOCK, Base::BIND, Base::CHAT, Base::CONFIG, Base::DISPLAY, Base::EMOTE, Base::EXIT, Base::EXPORT, Base::HELP, Base::IDENTITY, Base::IMPORT, Base::IRB, Base::OFFLINE, Base::PING, Base::PING_ALL, Base::QUIT, Base::REMOVE, Base::RM, Base::ROLL, Base::SEND_DISCONNECT, Base::SERVER, Base::SERVERS, Base::SET, Base::SHARE, Base::WHISPER_LOCK, Base::WHO

Instance Attribute Summary

Attributes inherited from Base

#_input, #_input_factory, #_message_dispatcher, #_message_factory

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Meshchat::Ui::Command::Base

Class Method Details

.descriptionObject



7
8
9
# File 'lib/meshchat/ui/command/server.rb', line 7

def self.description
  'known server statuses'
end

Instance Method Details

#handleObject



11
12
13
14
15
16
17
18
# File 'lib/meshchat/ui/command/server.rb', line 11

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