Class: Meshchat::Network::Message::NodeListHash
- Defined in:
- lib/meshchat/network/message/node_list_hash.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
-
#handle ⇒ NilClass
node list hash is received.
- #message ⇒ Object
- #respond ⇒ Object
Methods inherited from Base
#client, #client_version, #display, #encrypt_for, #initialize, #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
#handle ⇒ NilClass
node list hash is received
12 13 14 15 |
# File 'lib/meshchat/network/message/node_list_hash.rb', line 12 def handle respond nil end |
#message ⇒ Object
6 7 8 |
# File 'lib/meshchat/network/message/node_list_hash.rb', line 6 def @_message ||= Node.as_sha512 end |
#respond ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/meshchat/network/message/node_list_hash.rb', line 17 def respond if != Node.as_sha512 Display.debug 'node list hashes do not match' node_list = .create( NODE_LIST, data: { message: Node.as_json } ) .( uid: payload['sender']['uid'], message: node_list ) else Display.debug 'node list hash matches' end end |