Class: Rmega::Nodes::File

Inherits:
Node
  • Object
show all
Includes:
Deletable, Downloadable
Defined in:
lib/rmega/nodes/file.rb

Instance Attribute Summary

Attributes inherited from Node

#data, #session

Instance Method Summary collapse

Methods included from Downloadable

#allocate, #decrypt_chunk, #download, #download_chunk, #write_chunk

Methods included from Deletable

#delete, #trash

Methods inherited from Node

#attributes, #decrypted_file_key, #file_key, #file_keys, #handle, #initialize, #name, #parent_handle, #process_shared_key, #public_handle, #public_url, #public_url=, #shared_root?, #type

Methods included from Traversable

#children, #empty?, #files, #folders, #parent

Methods included from Loggable

#logger

Constructor Details

This class inherits a constructor from Rmega::Nodes::Node

Instance Method Details

#filesizeObject


19
20
21
# File 'lib/rmega/nodes/file.rb', line 19

def filesize
  size
end

#sizeObject


15
16
17
# File 'lib/rmega/nodes/file.rb', line 15

def size
  data['s']
end

#storage_urlObject


11
12
13
# File 'lib/rmega/nodes/file.rb', line 11

def storage_url
  @storage_url ||= data['g'] || request(a: 'g', g: 1, n: handle)['g']
end