Class: Del::SendMessage
- Inherits:
-
Object
- Object
- Del::SendMessage
- Defined in:
- lib/del/send_message.rb
Instance Method Summary collapse
-
#initialize(shell, socket_file:) ⇒ SendMessage
constructor
A new instance of SendMessage.
- #run(jid, message) ⇒ Object
Constructor Details
#initialize(shell, socket_file:) ⇒ SendMessage
Returns a new instance of SendMessage.
5 6 7 8 |
# File 'lib/del/send_message.rb', line 5 def initialize(shell, socket_file:) @shell = shell @socket = SocketMessage.new(@shell, socket_file: socket_file) end |
Instance Method Details
#run(jid, message) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/del/send_message.rb', line 10 def run(jid, ) @socket.deliver( command: :send_message, jid: jid, message: ) @shell.say(@socket.listen, :green) ensure @socket.close end |