class Basecamp3::Comment

A model for Basecamp's Comment

{github.com/basecamp/bc3-api/blob/master/sections/comments.md#comments For more information, see the official Basecamp3 API documentation for Comments}

Constants

REQUIRED_FIELDS

Attributes

bucket_id[RW]
content[RW]
created_at[RW]
id[RW]
parent_id[RW]
status[RW]
updated_at[RW]

Public Class Methods

all(bucket_id, parent_id, params = {}) click to toggle source

Returns a paginated list of active comments.

@param [Hash] params additional parameters @option params [Integer] :page (optional) to paginate results

@return [Array<Basecamp3::Comment>]

# 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) click to toggle source

Creates a comment.

@param [Integer] bucket_id the id of the bucket @param [Integer] parent_id the id of the parent @param [Hash] data the data to create a comment with @option params [String] :content (required) the body of the comment

@return [Basecamp3::Comment]

# 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
find(bucket_id, id) click to toggle source

Returns the comment.

@param [Integer] bucket_id the id of the bucket @param [Integer] id the id of the comment

@return [Basecamp3::Comment]

# File lib/basecamp3/models/comment.rb, line 36
def self.find(bucket_id, id)
  Basecamp3.request.get("/buckets/#{bucket_id}/comments/#{id}", {}, Basecamp3::Comment)
end
update(bucket_id, id, data) click to toggle source

Updates the comment.

@param [Integer] bucket_id the id of the bucket @param [Integer] id the id of the comment @param [Hash] data the data to update the comment with @option params [String] :content (required) the body of the comment

@return [Basecamp3::Comment]

# File lib/basecamp3/models/comment.rb, line 61
def self.update(bucket_id, id, data)
  self.validate_required(data)
  Basecamp3.request.put("/buckets/#{bucket_id}/comments/#{id}", data, Basecamp3::Comment)
end