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.
48 49 50 51 52 53 |
# File 'lib/nanite/packets.rb', line 48 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.
46 47 48 |
# File 'lib/nanite/packets.rb', line 46 def dest @dest end |
#filename ⇒ Object
Returns the value of attribute filename.
46 47 48 |
# File 'lib/nanite/packets.rb', line 46 def filename @filename end |
#token ⇒ Object
Returns the value of attribute token.
46 47 48 |
# File 'lib/nanite/packets.rb', line 46 def token @token end |
Class Method Details
.json_create(o) ⇒ Object
55 56 57 58 |
# File 'lib/nanite/packets.rb', line 55 def self.json_create(o) i = o['data'] new(i['filename'], i['dest'], i['token'], o['size']) end |
Instance Method Details
#to_s ⇒ Object
60 61 62 |
# File 'lib/nanite/packets.rb', line 60 def to_s "#{super} <#{token}> #{filename} to #{dest}" end |