Class: Basecamp3::Document
- Includes:
- Concerns::Bucketable, Concerns::Commentable, Concerns::Creatorable, Concerns::Parentable, Concerns::Recordingable
- Defined in:
- lib/basecamp3/models/document.rb
Overview
A model for Basecamp's Document
For more information, see the official Basecamp3 API documentation for Documents
Constant Summary
- REQUIRED_FIELDS =
%w(title content)
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#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.
Attributes included from Concerns::Commentable
Class Method Summary collapse
-
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::Document>
Returns a paginated list of active documents.
-
.create(bucket_id, parent_id, data) ⇒ Basecamp3::Document
Creates a document.
-
.find(bucket_id, id) ⇒ Basecamp3::Document
Returns the document.
-
.update(bucket_id, id, data) ⇒ Basecamp3::Document
Updates the document.
Methods included from Concerns::Commentable
Methods included from Concerns::Recordingable
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
#content ⇒ Object
Returns the value of attribute content
11 12 13 |
# File 'lib/basecamp3/models/document.rb', line 11 def content @content end |
#created_at ⇒ Object
Returns the value of attribute created_at
11 12 13 |
# File 'lib/basecamp3/models/document.rb', line 11 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id
11 12 13 |
# File 'lib/basecamp3/models/document.rb', line 11 def id @id end |
#status ⇒ Object
Returns the value of attribute status
11 12 13 |
# File 'lib/basecamp3/models/document.rb', line 11 def status @status end |
#title ⇒ Object
Returns the value of attribute title
11 12 13 |
# File 'lib/basecamp3/models/document.rb', line 11 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
11 12 13 |
# File 'lib/basecamp3/models/document.rb', line 11 def updated_at @updated_at end |
Class Method Details
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::Document>
Returns a paginated list of active documents.
28 29 30 |
# File 'lib/basecamp3/models/document.rb', line 28 def self.all(bucket_id, parent_id, params = {}) Basecamp3.request.get("/buckets/#{bucket_id}/vaults/#{parent_id}/documents", params, Basecamp3::Document) end |
.create(bucket_id, parent_id, data) ⇒ Basecamp3::Document
Creates a document.
52 53 54 55 |
# File 'lib/basecamp3/models/document.rb', line 52 def self.create(bucket_id, parent_id, data) self.validate_required(data) Basecamp3.request.post("/buckets/#{bucket_id}/vaults/#{parent_id}/documents", data, Basecamp3::Document) end |