Class: Basecamp3::Questionnaire

Inherits:
Model
  • Object
show all
Includes:
Concerns::Bucketable, Concerns::Creatorable
Defined in:
lib/basecamp3/models/questionnaire.rb

Overview

Constant Summary

Constants inherited from Model

Model::REQUIRED_FIELDS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Concerns::Bucketable

#bucket

Methods included from Concerns::Creatorable

#creator

Methods inherited from Model

#initialize

Constructor Details

This class inherits a constructor from Basecamp3::Model

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at



8
9
10
# File 'lib/basecamp3/models/questionnaire.rb', line 8

def created_at
  @created_at
end

#idObject

Returns the value of attribute id



8
9
10
# File 'lib/basecamp3/models/questionnaire.rb', line 8

def id
  @id
end

#nameObject

Returns the value of attribute name



8
9
10
# File 'lib/basecamp3/models/questionnaire.rb', line 8

def name
  @name
end

#questions_countObject

Returns the value of attribute questions_count



8
9
10
# File 'lib/basecamp3/models/questionnaire.rb', line 8

def questions_count
  @questions_count
end

#statusObject

Returns the value of attribute status



8
9
10
# File 'lib/basecamp3/models/questionnaire.rb', line 8

def status
  @status
end

#updated_atObject

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.

Parameters:

  • bucket_id (Integer)

    the id of the bucket

  • id (Integer)

    the id of the questionnaire

Returns:



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

#questionsArray<Basecamp3::Question>

Returns a list of related questions.

Returns:



18
19
20
# File 'lib/basecamp3/models/questionnaire.rb', line 18

def questions
  @mapped_questions ||= Basecamp3::Question.all(bucket.id, id)
end