Class: Nanite::FileChunk
Overview
packet that carries data chunks during a file transfer
Instance Attribute Summary collapse
-
#chunk ⇒ Object
Returns the value of attribute chunk.
-
#token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(token, chunk = nil) ⇒ FileChunk
constructor
A new instance of FileChunk.
Methods inherited from Packet
Constructor Details
#initialize(token, chunk = nil) ⇒ FileChunk
Returns a new instance of FileChunk.
50 51 52 53 |
# File 'lib/nanite/packets.rb', line 50 def initialize(token, chunk=nil) @chunk = chunk @token = token end |
Instance Attribute Details
#chunk ⇒ Object
Returns the value of attribute chunk.
49 50 51 |
# File 'lib/nanite/packets.rb', line 49 def chunk @chunk end |
#token ⇒ Object
Returns the value of attribute token.
49 50 51 |
# File 'lib/nanite/packets.rb', line 49 def token @token end |
Class Method Details
.json_create(o) ⇒ Object
54 55 56 57 |
# File 'lib/nanite/packets.rb', line 54 def self.json_create(o) i = o['data'] new(i['token'], i['chunk']) end |