isurvey 0.1.0 → 0.1.1

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWRjNmIxOTRhMTViNDk1NWQyMDRjZmE0OWFlMWYxYzM4YzIxYWI3ZA==
4
+ ZDNmZjAwZDllYjEzZjJlMTM2MDIzNWZhMWU5MDdlMzM2NTAzNmMxOA==
5
5
  data.tar.gz: !binary |-
6
- NjFjZDRhMmU1MmZjOTM4NDI3ODdmZGE5N2RjNzhlYWY3MTMwOTAwMQ==
6
+ ZGNmMzA4NzkwNDJhY2NiOTEwMjIyYTFlOGY5ZTc3MzkxOTk2ODlhYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OGEyM2VkOGFjNTdmYWViOTZkMDk3MzFmOGMzYzNmM2MyYTViOGZmOTVhYzRh
10
- MDMxMDQ5NDExYTk5NWZlMWYzOTE3NDc2OGI3Njc4YTNmYzllMTdmNGZmN2Fj
11
- OTY0OGRhNjk1OTIyNTkxMjFjNDAzNmE2YTRjYjFjMDcyN2VjZGI=
9
+ YWNiYWM4NjA4ZjY1ZTc2NGM2YzdmNjIwMTEyZmI0NTQxNTFhYzg0NDdkYWVm
10
+ MmJjMzZjYmE4NWMwNzY4Y2QwY2EyY2QxMjY4MjQzMTdhM2IxNDgxN2ZmYTJi
11
+ ZTVmYTI5NmUxY2Y4MzBmOTRkNmFiOTg5MTI1MDQwODUwMGQxZDg=
12
12
  data.tar.gz: !binary |-
13
- MzI1NDk3MzY1YjYxMDZmNzEzYWVjNjMwNWM1YWQ3N2VjYzhjNzY4ODE2NDc0
14
- MmY4MWE1NjgzYTI1MDlmYTFmNDZlZGUwMmRiNzM3N2FkOGVlNTZhYjNiY2Q2
15
- MDIyNzNmZGNjZDFlYTI2YTU0MWJiNGZhYjE4ZGExODQ1NTk5MjY=
13
+ YWRjNDNkMjJjYTIzZWE1MWJiYjY4OTE1NGQ5MWZjZmRmNzc4NWQ2ZTE3ODhk
14
+ YzQ2MDg5YjFmYmUxYTU5OWExNTRhMWNiZTYwNzhjOTMyNWQ1MDUyMDNlNGM1
15
+ NzU4NmE3NjNkNzMyYmEzMGU3MmI0Zjg3MjAyNWYxZWYwN2YyMzM=
data/README.md CHANGED
@@ -37,7 +37,7 @@ To get a list of all answers:
37
37
 
38
38
  Isurvey::Answer.all
39
39
 
40
- All of the properties available through the iSurvey API are also available through the gem. You obtain a property value by calling for it on the appropriate class; for example, Isurvey::Answer.all.first.screen_id would give you the screen_id of the first Answer.
40
+ All of the properties available through the iSurvey API are also available through the gem. You obtain a property value by calling for it on the appropriate class; for example, Isurvey::Answer.first.screen_id would give you the screen_id of the first Answer.
41
41
 
42
42
  For questions, the available properties are:
43
43
 
@@ -52,14 +52,15 @@ Any property can also be used to find on either questions or answers. For examp
52
52
  Isurvey::Question.find_by_screen_id(:id)
53
53
  Isurvey::Answer.find_by_question_id(:id)
54
54
 
55
- You can query a question for its answers, or an answer for its questions.
55
+ You can query a question for its answers, or an answer for its question.
56
56
 
57
- Isurvey::Question.answers
58
- Isurvey::Answer.questions
57
+ Isurvey::Question.first.answers
58
+ Isurvey::Answer.first.question
59
59
 
60
- You can also find answers by result id to a question.
60
+ You can also find answers by result id.
61
61
 
62
- Isurvey::Question.answers_by_result_id(:id)
62
+ Isurvey::Question.first.answers_by_result_id(:id)
63
+ Isurvey::Answer.by_result_id(:id)
63
64
 
64
65
  Questions and Answers have shortcut methods that allow you to query for the first or some index:
65
66
 
@@ -72,6 +73,11 @@ Get a list of the result ids:
72
73
 
73
74
  Isurvey::API.result_ids
74
75
 
76
+ These are also available, though I advise against using them unless there is a good reason:
77
+
78
+ Isurvey::API.questions
79
+ Isurvey::API.answers
80
+
75
81
  ## Contributing
76
82
 
77
83
  1. Fork it
@@ -7,5 +7,11 @@ module Isurvey
7
7
  def question
8
8
  Question.find_by_screen_id(self.screen_id)
9
9
  end
10
+
11
+ def self.by_result_id(id)
12
+ all.select do |answer|
13
+ answer.result_id == id
14
+ end
15
+ end
10
16
  end
11
17
  end
@@ -1,3 +1,3 @@
1
1
  module Isurvey
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isurvey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Nipper