wes-data-api 5.7.0 → 5.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wes/data/api.rb +1 -1
- data/lib/wes/data/api/challenge.rb +8 -0
- data/lib/wes/data/api/model/challenge.rb +22 -0
- data/lib/wes/data/api/model/challenge_answer.rb +12 -0
- data/lib/wes/data/api/model/challenge_question.rb +12 -0
- data/lib/wes/data/api/routes.rb +3 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9d7e3feb5d924248ed2e05b45c160112dc074c1
|
4
|
+
data.tar.gz: 3d588f128cdeae7e536445a166c32c2b41de837c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d95688411e28e28883efdd4eebbac38cf38865489a3549876037ecca17219ed4baad45e323088f8808080bf8b82dab79c814f89d18d98ff53d99c799f1a023d
|
7
|
+
data.tar.gz: 130478f25f1cc6ace114a94efce5a8115c8e8dfb2e186f87de2880cda27d170c5681142da68ff8f05b5c5a9a4c3f5ee3beb50158c19157ef0075833f2385291d
|
data/lib/wes/data/api.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "wes/data/api/base"
|
2
2
|
require "wes/data/api/model/challenge"
|
3
|
+
require "wes/data/api/model/challenge_question"
|
3
4
|
|
4
5
|
module Wes
|
5
6
|
module Data
|
@@ -26,6 +27,13 @@ module Wes
|
|
26
27
|
attributes.nil? ? nil : model_klass.new(attributes)
|
27
28
|
end
|
28
29
|
|
30
|
+
def questions
|
31
|
+
route = [routes.challenge, routes.questions].join("/")
|
32
|
+
map_objects(
|
33
|
+
client.get(route), Wes::Data::API::Model::ChallengeQuestion
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
29
37
|
private
|
30
38
|
|
31
39
|
def model_klass
|
@@ -2,12 +2,28 @@ require "wes/data/api/model/base"
|
|
2
2
|
require "wes/data/api/model/reward"
|
3
3
|
require "wes/data/api/model/creator_user"
|
4
4
|
require "wes/data/api/model/video"
|
5
|
+
require "wes/data/api/model/challenge_answer"
|
5
6
|
|
6
7
|
module Wes
|
7
8
|
module Data
|
8
9
|
module API
|
9
10
|
module Model
|
10
11
|
class Challenge < Base
|
12
|
+
def answers
|
13
|
+
map_objects(
|
14
|
+
client.get(answers_route),
|
15
|
+
Wes::Data::API::Model::ChallengeAnswer
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
def add_answers(answers)
|
20
|
+
client.post(answers_route, answers)
|
21
|
+
end
|
22
|
+
|
23
|
+
def update_answers(answers)
|
24
|
+
client.put(answers_route, answers)
|
25
|
+
end
|
26
|
+
|
11
27
|
def rewards
|
12
28
|
route = [routes.challenge, id, routes.rewards].join("/")
|
13
29
|
map_objects(
|
@@ -45,6 +61,12 @@ module Wes
|
|
45
61
|
client.get(route), Wes::Data::API::Model::Video
|
46
62
|
)
|
47
63
|
end
|
64
|
+
|
65
|
+
private
|
66
|
+
|
67
|
+
def answers_route
|
68
|
+
[routes.challenge, id, routes.answers].join("/")
|
69
|
+
end
|
48
70
|
end
|
49
71
|
end
|
50
72
|
end
|
data/lib/wes/data/api/routes.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wes-data-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -133,6 +133,8 @@ files:
|
|
133
133
|
- lib/wes/data/api/model/brand.rb
|
134
134
|
- lib/wes/data/api/model/brand_user.rb
|
135
135
|
- lib/wes/data/api/model/challenge.rb
|
136
|
+
- lib/wes/data/api/model/challenge_answer.rb
|
137
|
+
- lib/wes/data/api/model/challenge_question.rb
|
136
138
|
- lib/wes/data/api/model/collective.rb
|
137
139
|
- lib/wes/data/api/model/creator_user.rb
|
138
140
|
- lib/wes/data/api/model/reward.rb
|