traitify 1.5.0 → 1.6.0

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: 7d1d8d46bde7ca60ee71d5c336dd2b4b6d2932fa
4
- data.tar.gz: 5d014d112832e1afac06b52a5aaac1d39bab2933
3
+ metadata.gz: ab1b60acbe471e198aa594d0c2d273eb9843f994
4
+ data.tar.gz: 2fde3313efa9ef3a30e6c2a9387c5a5b31587b07
5
5
  SHA512:
6
- metadata.gz: 89e2e2b8bbd83736b23098380e410e657973acc246d5548d4a9c2cafb5f03cb24645f3999dfadd48c9aa1af8c9eae2d189bc74e1af422ea89678a34520c4a43b
7
- data.tar.gz: 690079cdab2b80331c1b62ebd316046bb57f55d3aea46f2c8f67bad51ad748dbcfea96965f79b712e4af5d790d8e1188eb8d5ce3719ad6ab8ed7edb7853ec618
6
+ metadata.gz: 379d8e66c82fd71351b39bda0a2f85dad5113b9e9c4137f8993e9f8e6e2a7c26067e48329b2140a82c14761a189ef92ff27ba5c80088ba5b214f243d5c88b3e5
7
+ data.tar.gz: 4eaa4a5572322128f6e6fd5d5a08a3d524041316328a49657249e1b5218f8f42efa801be36dc586c1e2f924aaabfae6ebcbc2cfa947ee23fcda21fdfbb21df4c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- traitify (1.4.0)
4
+ traitify (1.6.0)
5
5
  faraday (~> 0.9.0)
6
6
  faraday_middleware (~> 0.9.0)
7
7
  hashie
@@ -21,7 +21,7 @@ GEM
21
21
  multipart-post (>= 1.2, < 3)
22
22
  faraday_middleware (0.9.1)
23
23
  faraday (>= 0.7.4, < 0.10)
24
- hashie (3.3.1)
24
+ hashie (3.3.2)
25
25
  method_source (0.8.2)
26
26
  multipart-post (2.0.0)
27
27
  pry (0.10.0)
@@ -1,14 +1,28 @@
1
1
  module Traitify
2
2
  class Client
3
3
  module Result
4
- def results(assessment_id, image_pack = nil)
4
+ def results(assessment_id, image_pack = nil, data = nil)
5
5
  image_pack ||= self.image_pack
6
+ old_results = false
7
+ if data.nil?
8
+ data = %w(types blends)
9
+ old_results = true
10
+ end
6
11
 
7
12
  response = image_pack ?
8
- get("/assessments/#{assessment_id}/personality_types?image_pack=#{image_pack}") :
9
- get("/assessments/#{assessment_id}/personality_types")
13
+ get("/assessments/#{assessment_id}?data=#{data.join(",")}&image_pack=#{image_pack}") :
14
+ get("/assessments/#{assessment_id}?data=#{data.join(",")}")
15
+
16
+ result = Hashie::Mash.new(response)
10
17
 
11
- Hashie::Mash.new(response)
18
+ if old_results
19
+ OpenStruct.new({
20
+ personality_blend: result.personality_blend,
21
+ personality_types: result.personality_types
22
+ })
23
+ else
24
+ result
25
+ end
12
26
  end
13
27
  alias_method :find_results, :results
14
28
 
@@ -1,3 +1,3 @@
1
1
  module Traitify
2
- VERSION = "1.5.0"
2
+ VERSION = "1.6.0"
3
3
  end
@@ -1,4 +1,9 @@
1
1
  {
2
+ "id": "assessment-uuid",
3
+ "deck_id": "deck-uuid",
4
+ "user_id": "toms-uuid",
5
+ "created_at": 1392153790744,
6
+ "completed_at": 1392153790744,
2
7
  "personality_blend": {
3
8
  "personality_type_1": {
4
9
  "id": "028095da-31c7-4ef9-8067-bcfe3f1cd549",
@@ -153,5 +158,87 @@
153
158
  },
154
159
  "score": -17
155
160
  }
161
+ ],
162
+ "personality_traits": [
163
+ {
164
+ "personality_trait": {
165
+ "name": "Imaginative",
166
+ "definition": "Able to think symbolically and play with ideas.",
167
+ "description": ""
168
+ },
169
+ "score": 100.0
170
+ },
171
+ {
172
+ "personality_trait": {
173
+ "name": "Observant",
174
+ "definition": "keenly perceptive and aware of one's environment",
175
+ "description": ""
176
+ },
177
+ "score": 100.0
178
+ },
179
+ {
180
+ "personality_trait": {
181
+ "name": "Particular",
182
+ "definition": "has preferences that are exact and detailed",
183
+ "description": ""
184
+ },
185
+ "score": 100.0
186
+ },
187
+ {
188
+ "personality_trait": {
189
+ "name": "Superficial",
190
+ "definition": "likes to stay on the surface and not dig too deeply",
191
+ "description": ""
192
+ },
193
+ "score": 100.0
194
+ },
195
+ {
196
+ "personality_trait": {
197
+ "name": "Visionary",
198
+ "definition": "can imagine how actions and ideas pursued in the present will effect the future",
199
+ "description": ""
200
+ },
201
+ "score": 100.0
202
+ },
203
+ {
204
+ "personality_trait": {
205
+ "name": "Eclectic",
206
+ "definition": "Having a variety of blended interests, tastes, beliefs, style",
207
+ "description": ""
208
+ },
209
+ "score": 60.0
210
+ },
211
+ {
212
+ "personality_trait": {
213
+ "name": "Concrete",
214
+ "definition": "A style of thinking that values facts and real objects",
215
+ "description": ""
216
+ },
217
+ "score": 55.5556
218
+ },
219
+ {
220
+ "personality_trait": {
221
+ "name": "Focused",
222
+ "definition": "can concentrate one's mind, either because of a sense of drivenness, or as a result of interest or self-discipline",
223
+ "description": ""
224
+ },
225
+ "score": 23.0769
226
+ },
227
+ {
228
+ "personality_trait": {
229
+ "name": "Open-Minded",
230
+ "definition": "Having a mind receptive to new ideas or ideas contrary to one's own beliefs",
231
+ "description": ""
232
+ },
233
+ "score": 14.2857
234
+ },
235
+ {
236
+ "personality_trait": {
237
+ "name": "Realistic",
238
+ "definition": "has a real sense of what is practical and workable",
239
+ "description": ""
240
+ },
241
+ "score": -14.2857
242
+ }
156
243
  ]
157
244
  }
@@ -0,0 +1,210 @@
1
+ {
2
+ "id": "assessment-uuid",
3
+ "deck_id": "deck-uuid",
4
+ "user_id": "toms-uuid",
5
+ "created_at": 1392153790744,
6
+ "completed_at": 1392153790744,
7
+ "personality_types": [
8
+ {
9
+ "personality_type": {
10
+ "id": "028095da-31c7-4ef9-8067-bcfe3f1cd549",
11
+ "name": "Analyzer",
12
+ "description": "Analyzers...are inquisitive. They delve, study and look deeply for information. They have a keen eye and an experimental nature. Analyzers use these capacities to figure out problems and search for the facts, often in a laboratory environment. They excel at going beyond the surface toward uncovering information and discovery.",
13
+ "badge": {
14
+ "image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/analyzer/full-color/small",
15
+ "image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/analayzer/full-color/medium",
16
+ "image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/analayzer/full-color/large",
17
+ "font_color": "fff",
18
+ "color_1": "81abf7",
19
+ "color_2": "6ea1ea",
20
+ "color_3": "1761ba"
21
+ }
22
+ },
23
+ "score": 67
24
+ },
25
+ {
26
+ "personality_type": {
27
+ "id": "2c9166c8-8c70-45d6-9c7b-7c975175b1fb",
28
+ "name": "Planner",
29
+ "description": "Planners...are the detail people. They are methodical, precise, and detail-oriented. Planners create systems to follow, and enjoy working with data, detail, words and numbers. Great at manipulating data, they love procedure and routine. Often found in office settings, they excel at completing detailed work in an organized manner.",
30
+ "badge": {
31
+ "image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/planner/full-color/small",
32
+ "image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/planner/full-color/medium",
33
+ "image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/planner/full-color/large",
34
+ "font_color": "fff",
35
+ "color_1": "ffed73",
36
+ "color_2": "f2df72",
37
+ "color_3": "f7d719"
38
+ }
39
+ },
40
+ "score": 67
41
+ },
42
+ {
43
+ "personality_type": {
44
+ "id": "02b7bbe5-1185-4443-9497-e916ae373a83",
45
+ "name": "Visionary",
46
+ "description": "Visionaries...are pioneers. They are great convincers and like to work with others in a “take charge” capacity. They love to take risks, make changes and set trends. They tend to be ambitious and energetic. Visionaries are often in positions of prominence in business and the public eye and excel at taking charge and gaining the confidence of others.",
47
+ "badge": {
48
+ "image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/visionary/flat/small",
49
+ "image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/visionary/flat/medium",
50
+ "image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/visionary/flat/large",
51
+ "font_color": "fff",
52
+ "color_1": "bc7def",
53
+ "color_2": "ac70e5",
54
+ "color_3": "5322a0"
55
+ }
56
+ },
57
+ "score": 67
58
+ },
59
+ {
60
+ "personality_type": {
61
+ "id": "f49525cc-59ba-4e2a-8dde-73ec1971d7ee",
62
+ "name": "Inventor",
63
+ "description": "Inventors...are creative. They take a contemporary, ‘out of the box’ approach to work and life. Inventors use themselves and other medium, often various forms of the arts, to communicate and interact with the world. Inventors excel when they are ‘lost in their work,’ completely engrossed in a project.",
64
+ "badge": {
65
+ "image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/inventor/full-color/small",
66
+ "image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/inventor/full-color/medium",
67
+ "image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/inventor/full-color/large",
68
+ "font_color": "fff",
69
+ "color_1": "7ff7e3",
70
+ "color_2": "74edd6",
71
+ "color_3": "26c6a7"
72
+ }
73
+ },
74
+ "score": 50
75
+ },
76
+ {
77
+ "personality_type": {
78
+ "id": "36c9af67-9447-4f4a-9d03-f6fb1f788f2d",
79
+ "name": "Action Taker",
80
+ "description": "Action-Takers...are hands-on doers. They use manual and physical skills, working with technology or machinery to complete tasks. Often there is an athletic aspect to their work. They are handy, practical, systematic, applied, and down-to-earth. They are drawn to jobs that involve a specific skill-set and a concrete task. They excel at solitary, goal-oriented work and getting the job done.",
81
+ "badge": {
82
+ "image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/action-taker/full-color/small",
83
+ "image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/action-taker/full-color/medium",
84
+ "image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/action-taker/full-color/large",
85
+ "font_color": "fff",
86
+ "color_1": "ffa466",
87
+ "color_2": "f79b5c",
88
+ "color_3": "ea813b"
89
+ }
90
+ },
91
+ "score": 17
92
+ },
93
+ {
94
+ "personality_type": {
95
+ "id": "9172e799-c971-4822-a3fe-660369eaeef5",
96
+ "name": "Mentor",
97
+ "description": "Mentors...are people-oriented. They have great communication skills and are most fulfilled when assisting or working directly with others to improve a personal or societal situation. Mentors are patient and compassionate and work best in a group or on a team toward a common goal. Mentors excel at working with others to help them learn and grow.",
98
+ "badge": {
99
+ "image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/mentor/full-color/small",
100
+ "image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/mentor/full-color/medium",
101
+ "image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/mentor/full-color/large",
102
+ "font_color": "fff",
103
+ "color_1": "f47171",
104
+ "color_2": "ea6c6c",
105
+ "color_3": "e24747"
106
+ }
107
+ },
108
+ "score": 0
109
+ },
110
+ {
111
+ "personality_type": {
112
+ "id": "9f1fd384-e321-48a4-b5f4-085b588af907",
113
+ "name": "Naturalist",
114
+ "description": "Naturalists...are attached to the natural world, frequently working with plants and animals in their environment. Often nature lovers, they like to experience the world outdoors. They are committed to preserving and protecting the planet and its natural resources. Serene, earthy, efficient and solid, they excel at working as one with the natural environment.",
115
+ "badge": {
116
+ "image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/naturalist/full-color/small",
117
+ "image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/naturalist/full-color/medium",
118
+ "image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/naturalist/full-color/large",
119
+ "font_color": "fff",
120
+ "color_1": "6ad379",
121
+ "color_2": "5bc467",
122
+ "color_3": "317239"
123
+ }
124
+ },
125
+ "score": -17
126
+ }
127
+ ],
128
+ "personality_traits": [
129
+ {
130
+ "personality_trait": {
131
+ "name": "Imaginative",
132
+ "definition": "Able to think symbolically and play with ideas.",
133
+ "description": ""
134
+ },
135
+ "score": 100.0
136
+ },
137
+ {
138
+ "personality_trait": {
139
+ "name": "Observant",
140
+ "definition": "keenly perceptive and aware of one's environment",
141
+ "description": ""
142
+ },
143
+ "score": 100.0
144
+ },
145
+ {
146
+ "personality_trait": {
147
+ "name": "Particular",
148
+ "definition": "has preferences that are exact and detailed",
149
+ "description": ""
150
+ },
151
+ "score": 100.0
152
+ },
153
+ {
154
+ "personality_trait": {
155
+ "name": "Superficial",
156
+ "definition": "likes to stay on the surface and not dig too deeply",
157
+ "description": ""
158
+ },
159
+ "score": 100.0
160
+ },
161
+ {
162
+ "personality_trait": {
163
+ "name": "Visionary",
164
+ "definition": "can imagine how actions and ideas pursued in the present will effect the future",
165
+ "description": ""
166
+ },
167
+ "score": 100.0
168
+ },
169
+ {
170
+ "personality_trait": {
171
+ "name": "Eclectic",
172
+ "definition": "Having a variety of blended interests, tastes, beliefs, style",
173
+ "description": ""
174
+ },
175
+ "score": 60.0
176
+ },
177
+ {
178
+ "personality_trait": {
179
+ "name": "Concrete",
180
+ "definition": "A style of thinking that values facts and real objects",
181
+ "description": ""
182
+ },
183
+ "score": 55.5556
184
+ },
185
+ {
186
+ "personality_trait": {
187
+ "name": "Focused",
188
+ "definition": "can concentrate one's mind, either because of a sense of drivenness, or as a result of interest or self-discipline",
189
+ "description": ""
190
+ },
191
+ "score": 23.0769
192
+ },
193
+ {
194
+ "personality_trait": {
195
+ "name": "Open-Minded",
196
+ "definition": "Having a mind receptive to new ideas or ideas contrary to one's own beliefs",
197
+ "description": ""
198
+ },
199
+ "score": 14.2857
200
+ },
201
+ {
202
+ "personality_trait": {
203
+ "name": "Realistic",
204
+ "definition": "has a real sense of what is practical and workable",
205
+ "description": ""
206
+ },
207
+ "score": -14.2857
208
+ }
209
+ ]
210
+ }
@@ -16,7 +16,7 @@ describe Traitify::Client do
16
16
  let(:result) { tom.find_results("assessment-uuid") }
17
17
 
18
18
  before(:each) do
19
- stub_it(:get, "/assessments/assessment-uuid/personality_types", "result")
19
+ stub_it(:get, "/assessments/assessment-uuid?data=types,blends", "result")
20
20
  end
21
21
 
22
22
  it "returns a result" do
@@ -24,13 +24,26 @@ describe Traitify::Client do
24
24
  end
25
25
  end
26
26
 
27
+ context "with data specified" do
28
+ let(:result) { tom.find_results("assessment-uuid", nil, %w(types traits)) }
29
+
30
+ before(:each) do
31
+ stub_it(:get, "/assessments/assessment-uuid?data=types,traits", "results_types_traits")
32
+ end
33
+
34
+ it "returns a result" do
35
+ expect(result.personality_types.first.personality_type.name).to eq("Analyzer")
36
+ expect(result.personality_traits.first.personality_trait.name).to eq("Imaginative")
37
+ end
38
+ end
39
+
27
40
  context "with an image pack" do
28
41
  context "set in the configurations" do
29
42
  let(:tom) { Traitify.new(image_pack: "full-color") }
30
43
  let(:result) { tom.find_results("assessment-uuid") }
31
44
 
32
45
  before(:each) do
33
- stub_it(:get, "/assessments/assessment-uuid/personality_types?image_pack=full-color", "result")
46
+ stub_it(:get, "/assessments/assessment-uuid?data=types,blends&image_pack=full-color", "result")
34
47
  end
35
48
 
36
49
  it "returns a result" do
@@ -42,7 +55,7 @@ describe Traitify::Client do
42
55
  let(:result) { tom.find_results("assessment-uuid", "full-color") }
43
56
 
44
57
  before(:each) do
45
- stub_it(:get, "/assessments/assessment-uuid/personality_types?image_pack=full-color", "result")
58
+ stub_it(:get, "/assessments/assessment-uuid?data=types,blends&image_pack=full-color", "result")
46
59
  end
47
60
 
48
61
  it "returns a result" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traitify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Prats
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-13 00:00:00.000000000 Z
11
+ date: 2015-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -165,6 +165,7 @@ files:
165
165
  - spec/support/mocks/decks.json
166
166
  - spec/support/mocks/personality_traits.json
167
167
  - spec/support/mocks/result.json
168
+ - spec/support/mocks/results_types_traits.json
168
169
  - spec/support/mocks/slide.json
169
170
  - spec/support/mocks/slides.json
170
171
  - spec/support/mocks/slides_complete.json
@@ -204,6 +205,7 @@ test_files:
204
205
  - spec/support/mocks/decks.json
205
206
  - spec/support/mocks/personality_traits.json
206
207
  - spec/support/mocks/result.json
208
+ - spec/support/mocks/results_types_traits.json
207
209
  - spec/support/mocks/slide.json
208
210
  - spec/support/mocks/slides.json
209
211
  - spec/support/mocks/slides_complete.json