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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f05c131a54869a391cf1984e73ae5dfb8dc8f24
4
- data.tar.gz: 9d24375b2f57d3a80bcd61f2b514e55a414304f4
3
+ metadata.gz: a9d7e3feb5d924248ed2e05b45c160112dc074c1
4
+ data.tar.gz: 3d588f128cdeae7e536445a166c32c2b41de837c
5
5
  SHA512:
6
- metadata.gz: 7540bbaa30ad2d7fda8d3ef1ffa4c7499ac3649ab9e3be6f9b70cb2f15c37e2565f04129cc6f51f7dd0509c4efc94f63d65b3a9f0a6b449ba6856d5089a57dfe
7
- data.tar.gz: 6f61fb4ab37096de74dd37a9f65c81eac0fff2beed6bb4d8c24719994f4827ca3f586c401f4da67452b722a93c5707aa17f6dd19540be57f64185fc57e8cb592
6
+ metadata.gz: 8d95688411e28e28883efdd4eebbac38cf38865489a3549876037ecca17219ed4baad45e323088f8808080bf8b82dab79c814f89d18d98ff53d99c799f1a023d
7
+ data.tar.gz: 130478f25f1cc6ace114a94efce5a8115c8e8dfb2e186f87de2880cda27d170c5681142da68ff8f05b5c5a9a4c3f5ee3beb50158c19157ef0075833f2385291d
data/lib/wes/data/api.rb CHANGED
@@ -5,7 +5,7 @@ require "wes/data/api/configuration"
5
5
  module Wes
6
6
  module Data
7
7
  module API
8
- VERSION = "5.7.0".freeze
8
+ VERSION = "5.8.0".freeze
9
9
  end
10
10
  end
11
11
  end
@@ -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
@@ -0,0 +1,12 @@
1
+ require "wes/data/api/model/base"
2
+
3
+ module Wes
4
+ module Data
5
+ module API
6
+ module Model
7
+ class ChallengeAnswer < Base
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require "wes/data/api/model/base"
2
+
3
+ module Wes
4
+ module Data
5
+ module API
6
+ module Model
7
+ class ChallengeQuestion < Base
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -20,7 +20,9 @@ module Wes
20
20
  :submissions => "submissions",
21
21
  :video => "video",
22
22
  :videos => "videos",
23
- :transcoding_state => "transcoding-state"
23
+ :transcoding_state => "transcoding-state",
24
+ :questions => "questions",
25
+ :answers => "answers"
24
26
  )
25
27
  end
26
28
  end
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.7.0
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-17 00:00:00.000000000 Z
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