wes-data-api 13.2.0 → 13.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79633b945affda90482abfc6acd3daca44e71f6d
|
4
|
+
data.tar.gz: 1ee2aedccde953a1db3f1222cf01c8c133fa09ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 662bdd524b4542ab71e4cbc68c7064cfa709ab4d679151c4c7a88904b1756e43651e6b73bfe295ce08279b703c47706de2027a564e9a7eea1b995d5c367a8739
|
7
|
+
data.tar.gz: 117115b1b824995346c645eee7d13930966a8116c4c57d42c5d45e8a6b27039c29f8f3a0ce85db95a0b7cd870b23c563b76285064f5d06c90a6a592aa93702e2
|
data/lib/wes/data/api.rb
CHANGED
@@ -3,6 +3,7 @@ require 'wes/data/api/model/brief_rewards'
|
|
3
3
|
require 'wes/data/api/model/creator_user'
|
4
4
|
require 'wes/data/api/model/video'
|
5
5
|
require 'wes/data/api/model/brief_answer'
|
6
|
+
require 'wes/data/api/model/briefing_answer'
|
6
7
|
require 'wes/data/api/model/transaction'
|
7
8
|
require 'wes/data/api/model/video_partner_asset'
|
8
9
|
|
@@ -22,6 +23,13 @@ module Wes
|
|
22
23
|
client.post(answers_route, answers)
|
23
24
|
end
|
24
25
|
|
26
|
+
def briefing_answers
|
27
|
+
records = client.get(briefing_answers_route)
|
28
|
+
map_objects(
|
29
|
+
records, Wes::Data::API::Model::BriefingAnswer
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
25
33
|
def create_rewards(data)
|
26
34
|
route = [routes.brief, id, routes.brief_rewards].join('/')
|
27
35
|
records = client.post(route, data)
|
@@ -95,6 +103,10 @@ module Wes
|
|
95
103
|
[routes.brief, id, routes.answers].join('/')
|
96
104
|
end
|
97
105
|
|
106
|
+
def briefing_answers_route
|
107
|
+
[routes.briefing, id, routes.answers].join('/')
|
108
|
+
end
|
109
|
+
|
98
110
|
def fetch_brief_rewards
|
99
111
|
route = [routes.brief, id, routes.brief_rewards].join('/')
|
100
112
|
client.get(route)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'wes/data/api/model/base'
|
2
|
+
require 'wes/data/api/model/briefing_question'
|
3
|
+
|
4
|
+
module Wes
|
5
|
+
module Data
|
6
|
+
module API
|
7
|
+
module Model
|
8
|
+
class BriefingAnswer < Base
|
9
|
+
def id
|
10
|
+
ids_set? ? id_hash : nil
|
11
|
+
end
|
12
|
+
|
13
|
+
def question
|
14
|
+
map_objects(
|
15
|
+
@attributes.question,
|
16
|
+
Wes::Data::API::Model::BriefingQuestion
|
17
|
+
).first
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def ids_set?
|
23
|
+
!@attributes.brief_id.nil? && !@attributes.question_id.nil?
|
24
|
+
end
|
25
|
+
|
26
|
+
def id_hash
|
27
|
+
{
|
28
|
+
'brief_id' => @attributes.brief_id,
|
29
|
+
'question_id' => @attributes.question_id
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
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: 13.
|
4
|
+
version: 13.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -137,6 +137,8 @@ files:
|
|
137
137
|
- lib/wes/data/api/model/brief_answer.rb
|
138
138
|
- lib/wes/data/api/model/brief_question.rb
|
139
139
|
- lib/wes/data/api/model/brief_rewards.rb
|
140
|
+
- lib/wes/data/api/model/briefing_answer.rb
|
141
|
+
- lib/wes/data/api/model/briefing_question.rb
|
140
142
|
- lib/wes/data/api/model/collective.rb
|
141
143
|
- lib/wes/data/api/model/creator_user.rb
|
142
144
|
- lib/wes/data/api/model/showcase.rb
|