Class: Rmega::Nodes::Folder
- Includes:
- Deletable, Expandable, Traversable
- Defined in:
- lib/rmega/nodes/folder.rb
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
Methods included from Deletable
Methods included from Traversable
#children, #empty?, #files, #folders, #parent
Methods included from Expandable
#create_folder, #upload, #upload_url
Methods inherited from Node
#attributes, #can_decrypt_attributes?, #decrypted_file_key, #file_key, #handle, #initialize, #name, #owner_key, #parent_handle, #public_handle, #public_url, #public_url=, #type
Methods included from Loggable
Constructor Details
This class inherits a constructor from Rmega::Nodes::Node
Instance Method Details
#download(path) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rmega/nodes/folder.rb', line 15 def download(path) children.each do |node| if node.type == :file node.download path elsif node.type == :folder subfolder = ::File. ::File.join(path, node.name) Dir.mkdir(subfolder) unless Dir.exists?(subfolder) node.download subfolder end end nil end |