Class: Basecamp3::Comment
- Includes:
- Basecamp3::Concerns::Bucketable, Basecamp3::Concerns::Creatorable, Basecamp3::Concerns::Parentable, Basecamp3::Concerns::Recordingable
- Defined in:
- lib/basecamp3/models/comment.rb
Overview
A model for Basecamp's Comment
For more information, see the official Basecamp3 API documentation for Comments
Constant Summary
- REQUIRED_FIELDS =
%w(content)
Instance Attribute Summary collapse
-
#bucket_id ⇒ Object
Returns the value of attribute bucket_id.
-
#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.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
-
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::Comment>
Returns a paginated list of active comments.
-
.create(bucket_id, parent_id, data) ⇒ Basecamp3::Comment
Creates a comment.
-
.find(bucket_id, id) ⇒ Basecamp3::Comment
Returns the comment.
-
.update(bucket_id, id, data) ⇒ Basecamp3::Comment
Updates the comment.
Methods included from Basecamp3::Concerns::Recordingable
Methods included from Basecamp3::Concerns::Parentable
Methods included from Basecamp3::Concerns::Bucketable
Methods included from Basecamp3::Concerns::Creatorable
Methods inherited from Model
Constructor Details
This class inherits a constructor from Basecamp3::Model
Instance Attribute Details
#bucket_id ⇒ Object
Returns the value of attribute bucket_id
10 11 12 |
# File 'lib/basecamp3/models/comment.rb', line 10 def bucket_id @bucket_id end |
#content ⇒ Object
Returns the value of attribute content
10 11 12 |
# File 'lib/basecamp3/models/comment.rb', line 10 def content @content end |
#created_at ⇒ Object
Returns the value of attribute created_at
10 11 12 |
# File 'lib/basecamp3/models/comment.rb', line 10 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id
10 11 12 |
# File 'lib/basecamp3/models/comment.rb', line 10 def id @id end |
#parent_id ⇒ Object
Returns the value of attribute parent_id
10 11 12 |
# File 'lib/basecamp3/models/comment.rb', line 10 def parent_id @parent_id end |
#status ⇒ Object
Returns the value of attribute status
10 11 12 |
# File 'lib/basecamp3/models/comment.rb', line 10 def status @status end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
10 11 12 |
# File 'lib/basecamp3/models/comment.rb', line 10 def updated_at @updated_at end |
Class Method Details
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::Comment>
Returns a paginated list of active comments.
26 27 28 |
# File 'lib/basecamp3/models/comment.rb', line 26 def self.all(bucket_id, parent_id, params = {}) Basecamp3.request.get("/buckets/#{bucket_id}/recordings/#{parent_id}/comments", params, Basecamp3::Comment) end |
.create(bucket_id, parent_id, data) ⇒ Basecamp3::Comment
Creates a comment.
48 49 50 51 |
# File 'lib/basecamp3/models/comment.rb', line 48 def self.create(bucket_id, parent_id, data) self.validate_required(data) Basecamp3.request.post("/buckets/#{bucket_id}/recordings/#{parent_id}/comments", data, Basecamp3::Comment) end |