Class: MeshChat::Command::Whisper
- Inherits:
-
Base
- Object
- MeshChat::CLI::Input
- Base
- MeshChat::Command::Whisper
- Defined in:
- lib/meshchat/command/whisper.rb
Constant Summary
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
Attributes inherited from MeshChat::CLI::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
#handle ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/meshchat/command/whisper.rb', line 13 def handle node = Node.find_by_alias_name(target) if node m = Message::Whisper.new( message: , to: target ) Display.whisper m.display Net::Client.send( node: node, message: m ) else Display.alert "node for #{target} not found or is not online" end end |
#message ⇒ Object
9 10 11 |
# File 'lib/meshchat/command/whisper.rb', line 9 def command_args[1..command_args.length].try(:join, ' ') end |
#target ⇒ Object
4 5 6 7 |
# File 'lib/meshchat/command/whisper.rb', line 4 def target # get first arg command end |