Class: Nanite::FileEnd

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

Overview

packet that means end of a file transfer operation

Instance Attribute Summary collapse

Attributes inherited from Packet

#size

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Packet

#id_to_s, #to_json

Constructor Details

#initialize(token, meta, size = nil) ⇒ FileEnd

Returns a new instance of FileEnd.



71
72
73
74
75
# File 'lib/nanite/packets.rb', line 71

def initialize(token, meta, size=nil)
  @token = token
  @meta  = meta
  @size = size
end

Instance Attribute Details

#metaObject

Returns the value of attribute meta.



69
70
71
# File 'lib/nanite/packets.rb', line 69

def meta
  @meta
end

#tokenObject

Returns the value of attribute token.



69
70
71
# File 'lib/nanite/packets.rb', line 69

def token
  @token
end

Class Method Details

.json_create(o) ⇒ Object



77
78
79
80
# File 'lib/nanite/packets.rb', line 77

def self.json_create(o)
  i = o['data']
  new(i['token'], i['meta'], o['size'])
end

Instance Method Details

#to_sObject



82
83
84
# File 'lib/nanite/packets.rb', line 82

def to_s
  "#{super} <#{token}> meta #{meta}"
end