Class: Nanite::FileStart
Overview
packet that means start of a file transfer operation
Instance Attribute Summary collapse
-
#dest ⇒ Object
Returns the value of attribute dest.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#token ⇒ Object
Returns the value of attribute token.
Attributes inherited from Packet
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename, dest, token, size = nil) ⇒ FileStart
constructor
A new instance of FileStart.
- #to_s ⇒ Object
Methods inherited from Packet
Constructor Details
#initialize(filename, dest, token, size = nil) ⇒ FileStart
Returns a new instance of FileStart.
53 54 55 56 57 58 |
# File 'lib/nanite/packets.rb', line 53 def initialize(filename, dest, token, size=nil) @filename = filename @dest = dest @token = token @size = size end |
Instance Attribute Details
#dest ⇒ Object
Returns the value of attribute dest.
51 52 53 |
# File 'lib/nanite/packets.rb', line 51 def dest @dest end |
#filename ⇒ Object
Returns the value of attribute filename.
51 52 53 |
# File 'lib/nanite/packets.rb', line 51 def filename @filename end |
#token ⇒ Object
Returns the value of attribute token.
51 52 53 |
# File 'lib/nanite/packets.rb', line 51 def token @token end |
Class Method Details
.json_create(o) ⇒ Object
60 61 62 63 |
# File 'lib/nanite/packets.rb', line 60 def self.json_create(o) i = o['data'] new(i['filename'], i['dest'], i['token'], o['size']) end |
Instance Method Details
#to_s ⇒ Object
65 66 67 |
# File 'lib/nanite/packets.rb', line 65 def to_s wrap("#{super} <#{token}> #{filename} to #{dest}") end |