Class: Nanite::Register

Inherits:
Packet show all
Defined in:
lib/nanite/packets.rb

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Packet

#to_json

Constructor Details

#initialize(identity, services, status) ⇒ Register

Returns a new instance of Register.



154
155
156
157
158
# File 'lib/nanite/packets.rb', line 154

def initialize(identity, services, status)
  @status = status
  @identity = identity
  @services = services
end

Instance Attribute Details

#identityObject

Returns the value of attribute identity.



153
154
155
# File 'lib/nanite/packets.rb', line 153

def identity
  @identity
end

#servicesObject

Returns the value of attribute services.



153
154
155
# File 'lib/nanite/packets.rb', line 153

def services
  @services
end

#statusObject

Returns the value of attribute status.



153
154
155
# File 'lib/nanite/packets.rb', line 153

def status
  @status
end

Class Method Details

.json_create(o) ⇒ Object



159
160
161
162
# File 'lib/nanite/packets.rb', line 159

def self.json_create(o)
  i = o['data']
  new(i['identity'], i['services'], i['status'])
end