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, #wrap

Constructor Details

#initialize(identity, size = nil) ⇒ UnRegister

Returns a new instance of UnRegister.



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

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

Instance Attribute Details

#identityObject

Returns the value of attribute identity.



312
313
314
# File 'lib/nanite/packets.rb', line 312

def identity
  @identity
end

Class Method Details

.json_create(o) ⇒ Object



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

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

Instance Method Details

#to_sObject



324
325
326
# File 'lib/nanite/packets.rb', line 324

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