Class: Nanite::Ping
Overview
heartbeat packet
identity is sender’s identity status is sender’s status (see Register packet documentation)
Instance Attribute Summary collapse
-
#identity ⇒ Object
Returns the value of attribute identity.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from Packet
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(identity, status, size = nil) ⇒ Ping
constructor
A new instance of Ping.
- #to_s ⇒ Object
Methods inherited from Packet
Constructor Details
#initialize(identity, status, size = nil) ⇒ Ping
Returns a new instance of Ping.
377 378 379 380 381 |
# File 'lib/nanite/packets.rb', line 377 def initialize(identity, status, size=nil) @status = status @identity = identity @size = size end |
Instance Attribute Details
#identity ⇒ Object
Returns the value of attribute identity.
375 376 377 |
# File 'lib/nanite/packets.rb', line 375 def identity @identity end |
#status ⇒ Object
Returns the value of attribute status.
375 376 377 |
# File 'lib/nanite/packets.rb', line 375 def status @status end |
Class Method Details
.json_create(o) ⇒ Object
383 384 385 386 |
# File 'lib/nanite/packets.rb', line 383 def self.json_create(o) i = o['data'] new(i['identity'], i['status'], o['size']) end |
Instance Method Details
#to_s ⇒ Object
388 389 390 |
# File 'lib/nanite/packets.rb', line 388 def to_s "#{super} #{id_to_s(identity)} status #{status}" end |