Class: Meshchat::Network::Message::NodeListDiff

Inherits:
Base
  • Object
show all
Defined in:
lib/meshchat/network/message/node_list_diff.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, #display, #encrypt_for, #initialize, #message, #render, #respond, #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

#handleObject



6
7
8
9
10
11
12
13
14
# File 'lib/meshchat/network/message/node_list_diff.rb', line 6

def handle
  entries_we_do_not_have = message

  entries_we_do_not_have.each do |entry_as_json|
    # this will silently fail if there is a duplicate
    # or if this is an invalid entry
    Node.from_json(entry_as_json).save
  end
end