Class: Basecamp3::Question
- Defined in:
- lib/basecamp3/models/question.rb
Overview
A model for Basecamp's Question
For more information, see the official Basecamp3 API documentation for Questions
Constant Summary
Constants inherited from Model
Instance Attribute Summary collapse
-
#answers_count ⇒ Object
Returns the value of attribute answers_count.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#paused ⇒ Object
Returns the value of attribute paused.
-
#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.
Class Method Summary collapse
-
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::Question>
Returns a paginated list of questions.
-
.find(bucket_id, id) ⇒ Basecamp3::Question
Returns the question.
Instance Method Summary collapse
-
#answers ⇒ Array<Basecamp3::QuestionAnswer>
Returns a list of related answers.
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
#answers_count ⇒ Object
Returns the value of attribute answers_count
9 10 11 |
# File 'lib/basecamp3/models/question.rb', line 9 def answers_count @answers_count end |
#created_at ⇒ Object
Returns the value of attribute created_at
9 10 11 |
# File 'lib/basecamp3/models/question.rb', line 9 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id
9 10 11 |
# File 'lib/basecamp3/models/question.rb', line 9 def id @id end |
#paused ⇒ Object
Returns the value of attribute paused
9 10 11 |
# File 'lib/basecamp3/models/question.rb', line 9 def paused @paused end |
#status ⇒ Object
Returns the value of attribute status
9 10 11 |
# File 'lib/basecamp3/models/question.rb', line 9 def status @status end |
#title ⇒ Object
Returns the value of attribute title
9 10 11 |
# File 'lib/basecamp3/models/question.rb', line 9 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
9 10 11 |
# File 'lib/basecamp3/models/question.rb', line 9 def updated_at @updated_at end |
Class Method Details
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::Question>
Returns a paginated list of questions.
30 31 32 |
# 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 |
Instance Method Details
#answers ⇒ Array<Basecamp3::QuestionAnswer>
Returns a list of related answers.
20 21 22 |
# File 'lib/basecamp3/models/question.rb', line 20 def answers @mapped_answers ||= Basecamp3::QuestionAnswer.all(bucket.id, id) end |