Class: Nanite::Register
Overview
packet that means an availability notification sent from actor to mapper
from is sender identity services is a list of services provided by the node status is a load of the node by default, but may be any criteria
agent may use to report it's availability, load, etc
Instance Attribute Summary collapse
-
#identity ⇒ Object
Returns the value of attribute identity.
-
#services ⇒ Object
Returns the value of attribute services.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tags ⇒ Object
Returns the value of attribute tags.
Attributes inherited from Packet
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(identity, services, status, tags, size = nil) ⇒ Register
constructor
A new instance of Register.
- #to_s ⇒ Object
Methods inherited from Packet
Constructor Details
#initialize(identity, services, status, tags, size = nil) ⇒ Register
Returns a new instance of Register.
326 327 328 329 330 331 332 |
# File 'lib/nanite/packets.rb', line 326 def initialize(identity, services, status, , size=nil) @status = status @tags = @identity = identity @services = services @size = size end |
Instance Attribute Details
#identity ⇒ Object
Returns the value of attribute identity.
324 325 326 |
# File 'lib/nanite/packets.rb', line 324 def identity @identity end |
#services ⇒ Object
Returns the value of attribute services.
324 325 326 |
# File 'lib/nanite/packets.rb', line 324 def services @services end |
#status ⇒ Object
Returns the value of attribute status.
324 325 326 |
# File 'lib/nanite/packets.rb', line 324 def status @status end |
#tags ⇒ Object
Returns the value of attribute tags.
324 325 326 |
# File 'lib/nanite/packets.rb', line 324 def @tags end |
Class Method Details
.json_create(o) ⇒ Object
334 335 336 337 |
# File 'lib/nanite/packets.rb', line 334 def self.json_create(o) i = o['data'] new(i['identity'], i['services'], i['status'], i['tags'], o['size']) end |
Instance Method Details
#to_s ⇒ Object
339 340 341 342 343 344 |
# File 'lib/nanite/packets.rb', line 339 def to_s log_msg = "#{super} #{id_to_s(identity)}" log_msg += ", services: #{services.join(', ')}" if services && !services.empty? log_msg += ", tags: #{.join(', ')}" if && !.empty? log_msg end |