Class: Basecamp3::Vault
- Defined in:
- lib/basecamp3/models/vault.rb
Overview
A model for Basecamp's Vault
For more information, see the official Basecamp3 API documentation for Vaults
Constant Summary
- REQUIRED_FIELDS =
%w(title)
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#documents_count ⇒ Object
Returns the value of attribute documents_count.
-
#id ⇒ Object
Returns the value of attribute id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#uploads_count ⇒ Object
Returns the value of attribute uploads_count.
-
#vaults_count ⇒ Object
Returns the value of attribute vaults_count.
Class Method Summary collapse
-
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::Vault>
Returns a paginated list of active vaults.
-
.create(bucket_id, parent_id, data) ⇒ Basecamp3::Vault
Creates a vault.
-
.find(bucket_id, id) ⇒ Basecamp3::Vault
Returns the vault.
-
.update(bucket_id, id, data) ⇒ Basecamp3::Vault
Updates the vault.
Instance Method Summary collapse
-
#documents ⇒ Array<Basecamp3::Document>
Returns a list of related documents.
-
#vaults ⇒ Array<Basecamp3::Vault>
Returns a list of related vaults.
Methods included from Concerns::Parentable
Methods included from Concerns::Bucketable
Methods included from Concerns::Creatorable
Methods inherited from Model
Constructor Details
This class inherits a constructor from Basecamp3::Model
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at
9 10 11 |
# File 'lib/basecamp3/models/vault.rb', line 9 def created_at @created_at end |
#documents_count ⇒ Object
Returns the value of attribute documents_count
9 10 11 |
# File 'lib/basecamp3/models/vault.rb', line 9 def documents_count @documents_count end |
#id ⇒ Object
Returns the value of attribute id
9 10 11 |
# File 'lib/basecamp3/models/vault.rb', line 9 def id @id end |
#status ⇒ Object
Returns the value of attribute status
9 10 11 |
# File 'lib/basecamp3/models/vault.rb', line 9 def status @status end |
#title ⇒ Object
Returns the value of attribute title
9 10 11 |
# File 'lib/basecamp3/models/vault.rb', line 9 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
9 10 11 |
# File 'lib/basecamp3/models/vault.rb', line 9 def updated_at @updated_at end |
#uploads_count ⇒ Object
Returns the value of attribute uploads_count
9 10 11 |
# File 'lib/basecamp3/models/vault.rb', line 9 def uploads_count @uploads_count end |
#vaults_count ⇒ Object
Returns the value of attribute vaults_count
9 10 11 |
# File 'lib/basecamp3/models/vault.rb', line 9 def vaults_count @vaults_count end |
Class Method Details
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::Vault>
Returns a paginated list of active vaults.
40 41 42 |
# File 'lib/basecamp3/models/vault.rb', line 40 def self.all(bucket_id, parent_id, params = {}) Basecamp3.request.get("/buckets/#{bucket_id}/vaults/#{parent_id}/vaults", params, Basecamp3::Vault) end |
.create(bucket_id, parent_id, data) ⇒ Basecamp3::Vault
Creates a vault
62 63 64 65 |
# File 'lib/basecamp3/models/vault.rb', line 62 def self.create(bucket_id, parent_id, data) self.validate_required(data) Basecamp3.request.post("/buckets/#{bucket_id}/vaults/#{parent_id}/vaults", data, Basecamp3::Vault) end |
Instance Method Details
#documents ⇒ Array<Basecamp3::Document>
Returns a list of related documents.
23 24 25 |
# File 'lib/basecamp3/models/vault.rb', line 23 def documents @mapped_documents ||= Basecamp3::Document.all(bucket.id, id) end |
#vaults ⇒ Array<Basecamp3::Vault>
Returns a list of related vaults.
30 31 32 |
# File 'lib/basecamp3/models/vault.rb', line 30 def vaults @mapped_vaults ||= Basecamp3::Vault.all(bucket.id, id) end |