Class: Dalia::Api::SurveyPlatform::Client
- Inherits:
-
Object
- Object
- Dalia::Api::SurveyPlatform::Client
- Defined in:
- lib/dalia_api_survey_platform/client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#log ⇒ Object
readonly
Returns the value of attribute log.
-
#options ⇒ Object
Returns the value of attribute options.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #create_query(opts) ⇒ Object
- #fetch_completion(opts) ⇒ Object
- #fetch_completions(opts) ⇒ Object
- #fetch_completions_csv(opts) ⇒ Object
- #fetch_survey(opts) ⇒ Object
- #fetch_survey_price(opts) ⇒ Object
- #fetch_surveys ⇒ Object
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
- #send_survey(opts) ⇒ Object
- #update_survey(opts) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/dalia_api_survey_platform/client.rb', line 6 def initialize(opts = {}) @options = { :debug_mode => false, :api_host => "http://daliaresearch.com" }.merge!(opts) @log = Dalia::Api::SurveyPlatform::Log.new([:debug_mode]) log.() (, :api_host, :account_id) end |
Instance Attribute Details
#log ⇒ Object (readonly)
Returns the value of attribute log.
3 4 5 |
# File 'lib/dalia_api_survey_platform/client.rb', line 3 def log @log end |
#options ⇒ Object
Returns the value of attribute options.
2 3 4 |
# File 'lib/dalia_api_survey_platform/client.rb', line 2 def @options end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/dalia_api_survey_platform/client.rb', line 4 def response @response end |
Instance Method Details
#create_query(opts) ⇒ Object
58 59 60 61 |
# File 'lib/dalia_api_survey_platform/client.rb', line 58 def create_query(opts) (opts, :survey_id, :question_id) make_request_create_query(opts) end |
#fetch_completion(opts) ⇒ Object
48 49 50 51 |
# File 'lib/dalia_api_survey_platform/client.rb', line 48 def fetch_completion(opts) (opts, :survey_id, :completion_id) make_request_fetch_completion(opts) end |
#fetch_completions(opts) ⇒ Object
38 39 40 41 |
# File 'lib/dalia_api_survey_platform/client.rb', line 38 def fetch_completions(opts) (opts, :survey_id) make_request_fetch_completions(opts) end |
#fetch_completions_csv(opts) ⇒ Object
43 44 45 46 |
# File 'lib/dalia_api_survey_platform/client.rb', line 43 def fetch_completions_csv(opts) (opts, :survey_id) make_request_fetch_completions_csv(opts) end |
#fetch_survey(opts) ⇒ Object
23 24 25 26 |
# File 'lib/dalia_api_survey_platform/client.rb', line 23 def fetch_survey(opts) (opts, :survey_id) make_request_fetch_survey(opts) end |
#fetch_survey_price(opts) ⇒ Object
53 54 55 56 |
# File 'lib/dalia_api_survey_platform/client.rb', line 53 def fetch_survey_price(opts) (opts) make_request_fetch_survey_price(opts) end |
#fetch_surveys ⇒ Object
19 20 21 |
# File 'lib/dalia_api_survey_platform/client.rb', line 19 def fetch_surveys make_request_fetch_surveys({}) end |
#send_survey(opts) ⇒ Object
28 29 30 31 |
# File 'lib/dalia_api_survey_platform/client.rb', line 28 def send_survey(opts) (opts, :data) make_request_send_survey(opts) end |
#update_survey(opts) ⇒ Object
33 34 35 36 |
# File 'lib/dalia_api_survey_platform/client.rb', line 33 def update_survey(opts) (opts, :survey_id, :data) make_request_update_survey(opts) end |