Class: Nanite::Ping

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

Overview

heartbeat packet

identity is sender’s identity status is sender’s status (see Register packet documentation)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Packet

#to_json

Constructor Details

#initialize(identity, status) ⇒ Ping

Returns a new instance of Ping.



171
172
173
174
# File 'lib/nanite/packets.rb', line 171

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

Instance Attribute Details

#identityObject

Returns the value of attribute identity.



170
171
172
# File 'lib/nanite/packets.rb', line 170

def identity
  @identity
end

#statusObject

Returns the value of attribute status.



170
171
172
# File 'lib/nanite/packets.rb', line 170

def status
  @status
end

Class Method Details

.json_create(o) ⇒ Object



175
176
177
178
# File 'lib/nanite/packets.rb', line 175

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