Class: Basecamp3::Questionnaire
- Includes:
- Concerns::Bucketable, Concerns::Creatorable
- Defined in:
- lib/basecamp3/models/questionnaire.rb
Overview
A model for Basecamp's Questionnaire
For more information, see the official Basecamp3 API documentation for Questionnaires
Constant Summary
Constants inherited from Model
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#questions_count ⇒ Object
Returns the value of attribute questions_count.
-
#status ⇒ Object
Returns the value of attribute status.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
-
.find(bucket_id, id) ⇒ Basecamp3::Questionnaire
Returns the questionnaire.
Instance Method Summary collapse
-
#questions ⇒ Array<Basecamp3::Question>
Returns a list of related questions.
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
#created_at ⇒ Object
Returns the value of attribute created_at
8 9 10 |
# File 'lib/basecamp3/models/questionnaire.rb', line 8 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id
8 9 10 |
# File 'lib/basecamp3/models/questionnaire.rb', line 8 def id @id end |
#name ⇒ Object
Returns the value of attribute name
8 9 10 |
# File 'lib/basecamp3/models/questionnaire.rb', line 8 def name @name end |
#questions_count ⇒ Object
Returns the value of attribute questions_count
8 9 10 |
# File 'lib/basecamp3/models/questionnaire.rb', line 8 def questions_count @questions_count end |
#status ⇒ Object
Returns the value of attribute status
8 9 10 |
# File 'lib/basecamp3/models/questionnaire.rb', line 8 def status @status end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
8 9 10 |
# File 'lib/basecamp3/models/questionnaire.rb', line 8 def updated_at @updated_at end |
Class Method Details
.find(bucket_id, id) ⇒ Basecamp3::Questionnaire
Returns the questionnaire.
28 29 30 |
# File 'lib/basecamp3/models/questionnaire.rb', line 28 def self.find(bucket_id, id) Basecamp3.request.get("/buckets/#{bucket_id}/questionnaires/#{id}", {}, Basecamp3::Questionnaire) end |
Instance Method Details
#questions ⇒ Array<Basecamp3::Question>
Returns a list of related questions.
18 19 20 |
# File 'lib/basecamp3/models/questionnaire.rb', line 18 def questions @mapped_questions ||= Basecamp3::Question.all(bucket.id, id) end |