Class: Meshchat::Network::Message::Ping
- Defined in:
- lib/meshchat/network/message/ping.rb
Instance Attribute Summary
Attributes inherited from Base
#_message, #_message_dispatcher, #_message_factory, #_sender_location, #_sender_name, #_sender_uid, #_time_received, #payload
Instance Method Summary collapse
Methods inherited from Base
#client, #client_version, #encrypt_for, #initialize, #message, #render, #sender, #sender_location, #sender_name, #sender_uid, #time_received, #time_received_as_date, #type
Constructor Details
This class inherits a constructor from Meshchat::Network::Message::Base
Instance Method Details
#display ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/meshchat/network/message/ping.rb', line 6 def display # we'll never display our own ping to someone else... # or shouldn't.... or there should be different output # TODO: display is a bad method name name = payload['sender']['alias'] location = payload['sender']['location'] "#{name}@#{location} pinged you." end |
#handle ⇒ Object
16 17 18 19 |
# File 'lib/meshchat/network/message/ping.rb', line 16 def handle respond display end |
#respond ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/meshchat/network/message/ping.rb', line 21 def respond reply = .create(PING_REPLY) .( uid: payload['sender']['uid'], message: reply ) end |