Class: Siteleaf::Collection
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#output ⇒ Object
Returns the value of attribute output.
-
#path ⇒ Object
Returns the value of attribute path.
-
#permalink ⇒ Object
Returns the value of attribute permalink.
-
#site_id ⇒ Object
Returns the value of attribute site_id.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Attributes inherited from Entity
Instance Method Summary collapse
- #create_endpoint ⇒ Object
- #documents ⇒ Object
- #entity_endpoint ⇒ Object
- #filename ⇒ Object
- #files ⇒ Object
- #identifier ⇒ Object
- #output? ⇒ Boolean
- #site ⇒ Object
Methods inherited from Entity
all, #attributes, #attributes=, class_name, create, delete, #delete, endpoint, find, #initialize, #save
Constructor Details
This class inherits a constructor from Siteleaf::Entity
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
5 6 7 |
# File 'lib/siteleaf/collection.rb', line 5 def created_at @created_at end |
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
5 6 7 |
# File 'lib/siteleaf/collection.rb', line 5 def directory @directory end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/siteleaf/collection.rb', line 5 def id @id end |
#metadata ⇒ Object
Returns the value of attribute metadata.
4 5 6 |
# File 'lib/siteleaf/collection.rb', line 4 def @metadata end |
#output ⇒ Object
Returns the value of attribute output.
4 5 6 |
# File 'lib/siteleaf/collection.rb', line 4 def output @output end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/siteleaf/collection.rb', line 4 def path @path end |
#permalink ⇒ Object
Returns the value of attribute permalink.
4 5 6 |
# File 'lib/siteleaf/collection.rb', line 4 def permalink @permalink end |
#site_id ⇒ Object
Returns the value of attribute site_id.
4 5 6 |
# File 'lib/siteleaf/collection.rb', line 4 def site_id @site_id end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/siteleaf/collection.rb', line 4 def title @title end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
5 6 7 |
# File 'lib/siteleaf/collection.rb', line 5 def updated_at @updated_at end |
#user_id ⇒ Object
Returns the value of attribute user_id.
4 5 6 |
# File 'lib/siteleaf/collection.rb', line 4 def user_id @user_id end |
Instance Method Details
#create_endpoint ⇒ Object
7 8 9 |
# File 'lib/siteleaf/collection.rb', line 7 def create_endpoint ::File.join("sites", site_id, "collections") end |
#documents ⇒ Object
23 24 25 26 |
# File 'lib/siteleaf/collection.rb', line 23 def documents result = Client.get "#{entity_endpoint}/documents" result.map { |r| Document.new(r) } if result.is_a? Array end |
#entity_endpoint ⇒ Object
11 12 13 |
# File 'lib/siteleaf/collection.rb', line 11 def entity_endpoint ::File.join(create_endpoint, identifier) end |
#filename ⇒ Object
37 38 39 |
# File 'lib/siteleaf/collection.rb', line 37 def filename path end |
#files ⇒ Object
28 29 30 31 |
# File 'lib/siteleaf/collection.rb', line 28 def files result = Client.get "#{entity_endpoint}/files" result.map { |r| File.new(r) } if result.is_a? Array end |
#identifier ⇒ Object
15 16 17 |
# File 'lib/siteleaf/collection.rb', line 15 def identifier path end |
#output? ⇒ Boolean
33 34 35 |
# File 'lib/siteleaf/collection.rb', line 33 def output? output == true end |