isurvey 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/README.md +12 -3
- data/lib/isurvey/api.rb +11 -0
- data/lib/isurvey/result.rb +10 -0
- data/lib/isurvey/version.rb +1 -1
- data/lib/isurvey.rb +1 -0
- data/spec/result_spec.rb +13 -0
- data/spec/spec_helper.rb +0 -4
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTViOTQwNTM2ZWMyMDE2MzRlMzJiYTAyMGE5MDQzYzQ0NGIwM2U2Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjIzMTdkMDc2ZTZmYjRkNGViMmJlMmZlNDFjNGZjY2ZhOWEyODhjNw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjAwMzAwNTY3YzQwMTNmZDA2YmE2YWJmNzZmYTBmMjUxNDJlYWIwOTdjM2Jl
|
10
|
+
Njg3N2E0YzNkN2JiMWI5NjBiMjNkOWVkM2ZkYjg3MmQ0MjFkZWRjYjhlY2U5
|
11
|
+
ZmU4OWRiZDE4OWVkNGI3YTNiNjAyNDkwODNiYWMwNWNmZWExZGI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTgyMDJlZmM3ZWQ4YmU3NjgwMWVjZTk5MGQxMTY0YThlZmFhZTVlZjNkMzE1
|
14
|
+
ODVhNzdhZGIzNjVmNjRmZmM5NWQwMTQzZTc2OWEyNGY2Y2RhNDFjNmE1NTEy
|
15
|
+
OWY0NTg1MjM2ZDA0YjBhYzc4MzBhNGM5ZDQxYTY4NDZjMWQ2YTQ=
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -21,7 +21,7 @@ You must set up your company identifier and survey password. Perhaps in config/
|
|
21
21
|
Isurvey::Credentials.company_identifier = [cp]
|
22
22
|
Isurvey::Credentials.survey_password = [sp]
|
23
23
|
|
24
|
-
Before being used, the API must be loaded. This can be done in your
|
24
|
+
Before being used, the API must be loaded. This can be done in your application controller or in any other place you see fit.
|
25
25
|
|
26
26
|
Isurvey::API.load
|
27
27
|
|
@@ -41,22 +41,31 @@ All of the properties available through the iSurvey API are also available throu
|
|
41
41
|
|
42
42
|
For questions, the available properties are:
|
43
43
|
|
44
|
-
:screen_id, :question_number, :screen_id_next, :show_labels, :selectable_images, :screen_text, :screen_instructions, :theme_class_id, :screen_options, :answers
|
44
|
+
:screen_id, :question_number, :screen_id_next, :show_labels, :selectable_images, :screen_text, :screen_instructions, :theme_class_id, :screen_options, :answers
|
45
45
|
|
46
46
|
For answers, the available properties are:
|
47
47
|
|
48
|
-
:screen_id, :question_id, :answer_id, :result_answer, :response_date
|
48
|
+
:screen_id, :question_id, :answer_id, :result_answer, :response_date, :question
|
49
|
+
|
50
|
+
For results, the available properties are:
|
51
|
+
|
52
|
+
:screen_results, :result_id, :result_device_name, :is_demo_survey, :survey_id, :survey_version, :survey_start_date, :survey_end_date, :result_location_accuracy, :result_location_altitude, :result_location_latitude, :result_location_longitude, :result_device_guid, :result_location_status, :is_incomplete, :answers
|
49
53
|
|
50
54
|
Any property can also be used to find on either questions or answers. For example:
|
51
55
|
|
52
56
|
Isurvey::Question.find_by_screen_id(:id)
|
53
57
|
Isurvey::Answer.find_by_question_id(:id)
|
58
|
+
Isurvey::Result.find_by_result_id(:id)
|
54
59
|
|
55
60
|
You can query a question for its answers, or an answer for its question.
|
56
61
|
|
57
62
|
Isurvey::Question.first.answers
|
58
63
|
Isurvey::Answer.first.question
|
59
64
|
|
65
|
+
You can get answers from a result.
|
66
|
+
|
67
|
+
Isurvey::Result.first.answers
|
68
|
+
|
60
69
|
You can also find answers by result id.
|
61
70
|
|
62
71
|
Isurvey::Question.first.answers_by_result_id(:id)
|
data/lib/isurvey/api.rb
CHANGED
@@ -3,6 +3,7 @@ module Isurvey
|
|
3
3
|
def self.load
|
4
4
|
questions
|
5
5
|
answers
|
6
|
+
results
|
6
7
|
end
|
7
8
|
|
8
9
|
def self.questions
|
@@ -37,6 +38,16 @@ module Isurvey
|
|
37
38
|
@answers
|
38
39
|
end
|
39
40
|
|
41
|
+
def self.results
|
42
|
+
unless @results
|
43
|
+
@results = []
|
44
|
+
survey_results.each do |result|
|
45
|
+
@results << Result.new(hash: result)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
@results
|
49
|
+
end
|
50
|
+
|
40
51
|
private
|
41
52
|
def self.survey
|
42
53
|
SOAPClient.export_survey.body[:export_survey_response][:export_survey_result]
|
data/lib/isurvey/version.rb
CHANGED
data/lib/isurvey.rb
CHANGED
data/spec/result_spec.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Isurvey::Result do
|
4
|
+
before :all do
|
5
|
+
Isurvey::Credentials.company_identifier = ENV["ISURVEY_COMPANY_IDENTIFIER"]
|
6
|
+
Isurvey::Credentials.survey_password = ENV["ISURVEY_SURVEY_PASSWORD"]
|
7
|
+
Isurvey::API.load
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should not be empty" do
|
11
|
+
Isurvey::Result.all.should_not be_blank
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isurvey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Nipper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -99,11 +99,13 @@ files:
|
|
99
99
|
- lib/isurvey/base.rb
|
100
100
|
- lib/isurvey/collector.rb
|
101
101
|
- lib/isurvey/question.rb
|
102
|
+
- lib/isurvey/result.rb
|
102
103
|
- lib/isurvey/soap_client.rb
|
103
104
|
- lib/isurvey/version.rb
|
104
105
|
- spec/answer_spec.rb
|
105
106
|
- spec/api_spec.rb
|
106
107
|
- spec/question_spec.rb
|
108
|
+
- spec/result_spec.rb
|
107
109
|
- spec/spec_helper.rb
|
108
110
|
homepage: http://github.com/mnipper/isurvey
|
109
111
|
licenses:
|
@@ -133,4 +135,5 @@ test_files:
|
|
133
135
|
- spec/answer_spec.rb
|
134
136
|
- spec/api_spec.rb
|
135
137
|
- spec/question_spec.rb
|
138
|
+
- spec/result_spec.rb
|
136
139
|
- spec/spec_helper.rb
|