Class: MeshChat::Message::NodeListDiff

Inherits:
Base
  • Object
show all
Defined in:
lib/meshchat/message/node_list_diff.rb

Instance Attribute Summary

Attributes inherited from Base

#message, #payload, #sender_location, #sender_name, #sender_uid, #time_recieved

Instance Method Summary collapse

Methods inherited from Base

#client, #client_version, #display, #initialize, #render, #respond, #type

Constructor Details

This class inherits a constructor from MeshChat::Message::Base

Instance Method Details

#handleObject



4
5
6
7
8
9
10
11
12
# File 'lib/meshchat/message/node_list_diff.rb', line 4

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