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.



354
355
356
357
# File 'lib/nanite/packets.rb', line 354

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

Instance Attribute Details

#identityObject

Returns the value of attribute identity.



352
353
354
# File 'lib/nanite/packets.rb', line 352

def identity
  @identity
end

Class Method Details

.json_create(o) ⇒ Object



359
360
361
362
# File 'lib/nanite/packets.rb', line 359

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

Instance Method Details

#to_sObject



364
365
366
# File 'lib/nanite/packets.rb', line 364

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