Module: QualtricsAPI::Client
- Included in:
- QualtricsAPI
- Defined in:
- lib/qualtrics_api/client.rb
Instance Method Summary collapse
- #connection ⇒ Object
- #panels(options = {}) ⇒ Object
- #response_exports(options = {}) ⇒ Object
- #surveys(options = {}) ⇒ Object
Instance Method Details
#connection ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/qualtrics_api/client.rb', line 18 def connection api_token ||= QualtricsAPI.api_token || fail('Please configure api token!') @conn ||= Faraday.new(url: QualtricsAPI::URL, params: { apiToken: api_token }) do |faraday| faraday.request :url_encoded faraday.response :json, :content_type => /\bjson$/ faraday.use FaradayMiddleware::FollowRedirects faraday.use QualtricsAPI::RequestErrorHandler faraday.adapter Faraday.default_adapter end end |
#panels(options = {}) ⇒ Object
14 15 16 |
# File 'lib/qualtrics_api/client.rb', line 14 def panels( = {}) @panels ||= QualtricsAPI::PanelCollection.new() end |
#response_exports(options = {}) ⇒ Object
10 11 12 |
# File 'lib/qualtrics_api/client.rb', line 10 def response_exports( = {}) @response_exports ||= QualtricsAPI::ResponseExportCollection.new() end |
#surveys(options = {}) ⇒ Object
5 6 7 8 |
# File 'lib/qualtrics_api/client.rb', line 5 def surveys( = {}) @surveys = nil if @surveys && @surveys.scope_id != [:scope_id] @surveys ||= QualtricsAPI::SurveyCollection.new() end |