Class: ActiveSP::Folder
Instance Attribute Summary
Attributes inherited from Item
Instance Method Summary collapse
- #create_document(parameters = {}) ⇒ Object
- #create_folder(parameters = {}) ⇒ Object
- #each_document(options = {}, &blk) ⇒ Object
- #each_folder(options = {}, &blk) ⇒ Object
-
#each_item(options = {}, &blk) ⇒ Array<Item>
Returns the list of items in this folder.
- #is_folder? ⇒ Boolean
-
#item(name) ⇒ Item
(also: #/)
Returns the item with the given name.
-
#key ⇒ String
See Base#key.
- #to_s ⇒ Object (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 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
#create_document(parameters = {}) ⇒ Object
70 71 72 |
# File 'lib/activesp/folder.rb', line 70 def create_document(parameters = {}) @list.create_document(parameters.merge(:folder => absolute_url)) end |
#create_folder(parameters = {}) ⇒ Object
57 58 59 |
# File 'lib/activesp/folder.rb', line 57 def create_folder(parameters = {}) @list.create_folder(parameters.merge(:folder => absolute_url)) end |
#each_document(options = {}, &blk) ⇒ Object
61 62 63 |
# File 'lib/activesp/folder.rb', line 61 def each_document( = {}, &blk) @list.each_document(.merge(:folder => self), &blk) end |
#each_folder(options = {}, &blk) ⇒ Object
48 49 50 |
# File 'lib/activesp/folder.rb', line 48 def each_folder( = {}, &blk) @list.each_folder(.merge(:folder => self), &blk) end |
#each_item(options = {}, &blk) ⇒ Array<Item>
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 |
#is_folder? ⇒ Boolean
36 37 38 |
# File 'lib/activesp/folder.rb', line 36 def is_folder? false end |
#item(name) ⇒ Item 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 |
#key ⇒ String
See Base#key
32 33 34 |
# File 'lib/activesp/folder.rb', line 32 def key encode_key("F", [@list.key, @id]) end |
#to_s ⇒ Object Also known as: inspect
94 95 96 |
# File 'lib/activesp/folder.rb', line 94 def to_s "#<ActiveSP::Folder url=#{url}>" end |