class Basecamp3::Question
A model for Basecamp's Question
{github.com/basecamp/bc3-api/blob/master/sections/questions.md#questions For more information, see the official Basecamp3
API documentation for Questions}
Attributes
answers_count[RW]
created_at[RW]
id[RW]
paused[RW]
status[RW]
title[RW]
updated_at[RW]
Public Class Methods
all(bucket_id, parent_id, params = {})
click to toggle source
Returns a paginated list of questions.
@param [Hash] params additional parameters @option params [Integer] :page (optional) to paginate results
@return [Array<Basecamp3::Question>]
# File lib/basecamp3/models/question.rb, line 30 def self.all(bucket_id, parent_id, params = {}) Basecamp3.request.get("/buckets/#{bucket_id}/questionnaires/#{parent_id}/questions", params, Basecamp3::Question) end
find(bucket_id, id)
click to toggle source
Returns the question.
@param [Integer] bucket_id the id of the bucket @param [Integer] id the id of the question
@return [Basecamp3::Question]
# File lib/basecamp3/models/question.rb, line 40 def self.find(bucket_id, id) Basecamp3.request.get("/buckets/#{bucket_id}/questions/#{id}", {}, Basecamp3::Question) end
Public Instance Methods
answers()
click to toggle source
Returns a list of related answers.
@return [Array<Basecamp3::QuestionAnswer>]
# File lib/basecamp3/models/question.rb, line 20 def answers @mapped_answers ||= Basecamp3::QuestionAnswer.all(bucket.id, id) end