Class: Megar::Folders
- Inherits:
-
Object
- Object
- Megar::Folders
- Includes:
- CatalogItem
- Defined in:
- lib/megar/catalog/folders.rb
Overview
Collection manager for folders
Instance Attribute Summary
Attributes included from CatalogItem
#id, #key, #name, #payload, #type
Instance Method Summary collapse
-
#add(attributes) ⇒ Object
Adds an item to the local cached collection given
attributes
hash. -
#inbox ⇒ Object
Returns the inbox folder.
-
#initialize(options = {}) ⇒ Folders
constructor
A new instance of Folders.
-
#root ⇒ Object
Returns the root (cloud drive) folder.
-
#trash ⇒ Object
Returns the trash folder.
Methods included from CatalogItem
#==, #[], #attributes=, #collection, #each, #find_by_type, #reset!, #resource_class
Constructor Details
#initialize(options = {}) ⇒ Folders
5 6 |
# File 'lib/megar/catalog/folders.rb', line 5 def initialize(={}) end |
Instance Method Details
#add(attributes) ⇒ Object
Adds an item to the local cached collection given attributes
hash.
9 10 11 |
# File 'lib/megar/catalog/folders.rb', line 9 def add(attributes) collection << Megar::Folder.new(attributes) end |
#inbox ⇒ Object
Returns the inbox folder
19 20 21 |
# File 'lib/megar/catalog/folders.rb', line 19 def inbox @inbox ||= find_by_type(3) end |
#root ⇒ Object
Returns the root (cloud drive) folder
14 15 16 |
# File 'lib/megar/catalog/folders.rb', line 14 def root @root ||= find_by_type(2) end |
#trash ⇒ Object
Returns the trash folder
24 25 26 |
# File 'lib/megar/catalog/folders.rb', line 24 def trash @trash ||= find_by_type(4) end |