surveymonkey_api 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8bc359925a55d08f4049c7c598e46033353fe89
4
- data.tar.gz: 3e1b6949d60743c49718c10f53d5e6ebc260d1fd
3
+ metadata.gz: bcf3859b47a173822cc172cb1413e15198ef6800
4
+ data.tar.gz: 6e10f8e675d4bc10d3c0fd678187be538b5e16d4
5
5
  SHA512:
6
- metadata.gz: 3c7cd0fe6019484d6f1786e89c6d88a4ef92375bc222e574533301b46c75ff7bfb753d33f7cdc43dc872840dd0308664ef95e051dc5d9e75df89475cfffd44a8
7
- data.tar.gz: 661890c803ecc86a3185fa3ea5e2597ed3cf7af12798644765d0758b91abe439657ab1fb7921e1047423b0d5910cf8be7183bdbe891afbb264f60b34d2807014
6
+ metadata.gz: 21c737a80312925e9e2b25973b6e9eae44edf00762d116e5d5e4a261b72f6d46c6288554a3c6e551728d09326810c4fcbe606a9922b257b93602c9699d670516
7
+ data.tar.gz: ebeb106e48c372d9695602aec6ac81e83422960445f789fb208d3032687d6c34b77847ecd06613fd333d682b70d5aabdc7962b6b52c8a10be0f0323f73809626
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- surveymonkey_api (0.2.2)
4
+ surveymonkey_api (0.2.4)
5
5
  httparty (~> 0.13)
6
6
 
7
7
  GEM
@@ -12,10 +12,10 @@ module Surveymonkey
12
12
  # Match answer title
13
13
  def title
14
14
  @title ||= if raw_data['text']
15
- raw_data['text']
16
- else
17
- answer_structure['choices'].detect {|c| c['id'] == id}['text']
18
- end
15
+ raw_data['text']
16
+ else
17
+ answer_structure['choices'].detect { |c| c['id'] == id }['text']
18
+ end
19
19
  end
20
20
  end
21
21
  end
@@ -16,7 +16,7 @@ module Surveymonkey
16
16
 
17
17
  def questions
18
18
  @questions ||= raw_data['questions'].each_with_object([]) do |question, arr|
19
- question_structure = page_structure['questions'].detect{|q| q['id'] == question['id']}
19
+ question_structure = page_structure['questions'].detect { |q| q['id'] == question['id'] }
20
20
  arr << Surveymonkey::Response::Question.new(question, question_structure)
21
21
  end
22
22
  end
@@ -11,13 +11,17 @@ module Surveymonkey
11
11
  end
12
12
 
13
13
  def raw_details(options = {})
14
- client.survey_response(survey_id, id, options)
14
+ @raw_details ||= client.survey_response(survey_id, id, options)
15
+ end
16
+
17
+ def info
18
+ raw_details.dup.tap { |h| h.delete('pages') }
15
19
  end
16
20
 
17
21
  def pages(options = {})
18
- @pages ||= client.survey_response(survey_id, id, options)['pages'].each_with_object([]) do |page, arr|
19
- if !page['questions'].empty?
20
- page_structure = details['pages'].detect{|p| p['id'] == page['id']}
22
+ @pages ||= raw_details(options)['pages'].each_with_object([]) do |page, arr|
23
+ unless page['questions'].empty?
24
+ page_structure = details['pages'].detect { |p| p['id'] == page['id'] }
21
25
  arr << Surveymonkey::Response::Page.new(page, page_structure)
22
26
  end
23
27
  end
@@ -1,3 +1,3 @@
1
1
  module SurveymonkeyApi
2
- VERSION = "0.2.3"
2
+ VERSION = '0.2.4'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require 'httparty'
2
2
  require 'uri'
3
- require "surveymonkey_api/version"
3
+ require 'surveymonkey_api/version'
4
4
  require 'surveymonkey_api/client/survey'
5
5
  require 'surveymonkey_api/client'
6
6
  require 'surveymonkey_api/survey'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: surveymonkey_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-04 00:00:00.000000000 Z
11
+ date: 2018-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler