Class: Nanite::UnRegister

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

Overview

packet that means deregister an agent from the mappers

from is sender identity

Instance Attribute Summary collapse

Attributes inherited from Packet

#size

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Packet

#id_to_s, #to_json

Constructor Details

#initialize(identity, size = nil) ⇒ UnRegister

Returns a new instance of UnRegister.



309
310
311
312
# File 'lib/nanite/packets.rb', line 309

def initialize(identity, size=nil)
  @identity = identity
  @size = size
end

Instance Attribute Details

#identityObject

Returns the value of attribute identity.



307
308
309
# File 'lib/nanite/packets.rb', line 307

def identity
  @identity
end

Class Method Details

.json_create(o) ⇒ Object



314
315
316
317
# File 'lib/nanite/packets.rb', line 314

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

Instance Method Details

#to_sObject



319
320
321
# File 'lib/nanite/packets.rb', line 319

def to_s
  "#{super} #{id_to_s(identity)}"
end