Class: Whatup::CLI::Dm
- Inherits:
-
Thor
- Object
- Thor
- Whatup::CLI::Dm
- Extended by:
- ThorInteractive
- Defined in:
- lib/whatup/cli/commands/interactive/dm.rb
Overview
Server commands
Constant Summary collapse
- Room =
Whatup::Server::Room
- Message =
Whatup::Server::Message
- Client =
Whatup::Server::Client
Instance Method Summary collapse
Methods included from ThorInteractive
Instance Method Details
#list ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/whatup/cli/commands/interactive/dm.rb', line 34 def list say 'Your direct messages:' say \ Message.where(sender: current_user) .or(Message.where(recipient: current_user)) .map(&:to_s) .join('-' * 10) end |
#msg(name) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/whatup/cli/commands/interactive/dm.rb', line 17 def msg name if recepient = Client.find_by(name: name) say " Sending a direct message to \#{name}...\n\n The message can span multiple lines.\n\n Type `.exit` when you're ready to send it.\n MSG\n current_user.composing_dm = recepient\n return\n end\n\n say \"That user doesn't exist!\"\nend\n" |