Class: ActiveSP::Folder
Instance Attribute Summary
Attributes inherited from Item
Instance Method Summary (collapse)
- - (Object) create_document(parameters = {})
- - (Object) create_folder(parameters = {})
- - (Object) each_document(options = {}, &blk)
- - (Object) each_folder(options = {}, &blk)
-
- (Array<Item>) each_item(options = {}, &blk)
Returns the list of items in this folder.
- - (Boolean) is_folder?
-
- (Item) item(name)
(also: #/)
Returns the item with the given name.
-
- (String) key
See Base#key.
- - (Object) to_s (also: #inspect)
Methods inherited from Item
#==, #ID, #absolute_url, #add_attachment, #attachment_urls, #cancel_checkout, #check_in, #check_out, #content, #content=, #content_type, #content_urls, #destroy, #each_attachment, #folder, #id, #initialize, #parent, #save, #uid, #update_attributes, #url
Methods included from Caching
Methods inherited from Base
#attribute, #attribute_type, #attribute_types, #attributes, #has_attribute?, #has_writable_attribute?, #method_missing, #reload, #save, #set_attribute
Constructor Details
This class inherits a constructor from ActiveSP::Item
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveSP::Base
Instance Method Details
- (Object) create_document(parameters = {})
70 71 72 |
# File 'lib/activesp/folder.rb', line 70 def create_document(parameters = {}) @list.create_document(parameters.merge(:folder => absolute_url, :folder_object => self)) end |
- (Object) create_folder(parameters = {})
57 58 59 |
# File 'lib/activesp/folder.rb', line 57 def create_folder(parameters = {}) @list.create_folder(parameters.merge(:folder => absolute_url)) end |
- (Object) each_document(options = {}, &blk)
61 62 63 |
# File 'lib/activesp/folder.rb', line 61 def each_document( = {}, &blk) @list.each_document(.merge(:folder => self), &blk) end |
- (Object) each_folder(options = {}, &blk)
48 49 50 |
# File 'lib/activesp/folder.rb', line 48 def each_folder( = {}, &blk) @list.each_folder(.merge(:folder => self), &blk) end |
- (Array<Item>) each_item(options = {}, &blk)
Returns the list of items in this folder
43 44 45 |
# File 'lib/activesp/folder.rb', line 43 def each_item( = {}, &blk) @list.each_item(.merge(:folder => self), &blk) end |
- (Boolean) is_folder?
36 37 38 |
# File 'lib/activesp/folder.rb', line 36 def is_folder? true end |
- (Item) item(name) Also known as: /
Returns the item with the given name
77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/activesp/folder.rb', line 77 def item(name) query = Builder::XmlMarkup.new.Query do |xml| xml.Where do |xml| xml.Eq do |xml| xml.FieldRef(:Name => "FileLeafRef") xml.Value(name, :Type => "Text") end end end items(:query => query).first end |
- (String) key
See Base#key
32 33 34 |
# File 'lib/activesp/folder.rb', line 32 def key encode_key("F", [@list.key, @id]) end |
- (Object) to_s Also known as: inspect
94 95 96 |
# File 'lib/activesp/folder.rb', line 94 def to_s "#<ActiveSP::Folder url=#{url}>" end |