Class: Nanite::TagUpdate
Overview
packet that is sent by agents to the mapper to update their tags
Instance Attribute Summary collapse
-
#identity ⇒ Object
Returns the value of attribute identity.
-
#new_tags ⇒ Object
Returns the value of attribute new_tags.
-
#obsolete_tags ⇒ Object
Returns the value of attribute obsolete_tags.
Attributes inherited from Packet
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(identity, new_tags, obsolete_tags, size = nil) ⇒ TagUpdate
constructor
A new instance of TagUpdate.
- #to_s ⇒ Object
Methods inherited from Packet
Constructor Details
#initialize(identity, new_tags, obsolete_tags, size = nil) ⇒ TagUpdate
Returns a new instance of TagUpdate.
415 416 417 418 419 420 |
# File 'lib/nanite/packets.rb', line 415 def initialize(identity, , , size=nil) @identity = identity @new_tags = @obsolete_tags = @size = size end |
Instance Attribute Details
#identity ⇒ Object
Returns the value of attribute identity.
413 414 415 |
# File 'lib/nanite/packets.rb', line 413 def identity @identity end |
#new_tags ⇒ Object
Returns the value of attribute new_tags.
413 414 415 |
# File 'lib/nanite/packets.rb', line 413 def @new_tags end |
#obsolete_tags ⇒ Object
Returns the value of attribute obsolete_tags.
413 414 415 |
# File 'lib/nanite/packets.rb', line 413 def @obsolete_tags end |
Class Method Details
.json_create(o) ⇒ Object
422 423 424 425 |
# File 'lib/nanite/packets.rb', line 422 def self.json_create(o) i = o['data'] new(i['identity'], i['new_tags'], i['obsolete_tags'], o['size']) end |
Instance Method Details
#to_s ⇒ Object
427 428 429 430 431 432 |
# File 'lib/nanite/packets.rb', line 427 def to_s log_msg = "#{super} #{id_to_s(identity)}" log_msg += ", new tags: #{.join(', ')}" if && !.empty? log_msg += ", obsolete tags: #{.join(', ')}" if && !.empty? log_msg end |