adriver_api 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/adriver_api/api_methods.rb +4 -4
- data/lib/adriver_api/version.rb +1 -1
- data/lib/adriver_api.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b19de168b6ade8ae3b5210a63651117cc56d657
|
4
|
+
data.tar.gz: 88c99c9e681b1b5f81e90d33f94fde67907e420e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2a01edb7257d049b01e730de2d93822f58c1eb37ee67dba94120328aba2e4fcd88c0b6276ae2ab55b9cd7235bd025315e135d5fee1d6f662aa6078e0585848e
|
7
|
+
data.tar.gz: da9c25c5e897affd57262de87bc6535565ee2d17cfd30e91fa9ec48fe9cc3facce483672d9737144c1362e9c8b98aa146f96bd102ded234b953b95d0853a1cf4
|
@@ -14,7 +14,7 @@ module AdriverApi
|
|
14
14
|
def ads_delegated(raw: false)
|
15
15
|
response = make_request('ads/delegated', user_id: @user_id.to_s)
|
16
16
|
return response if raw
|
17
|
-
Array(response.body['feed']['entry']).map{|x| x['id'].split('/').last}
|
17
|
+
Array.wrap(response.body['feed']['entry']).map{|x| x['id'].split('/').last}
|
18
18
|
end
|
19
19
|
|
20
20
|
# Info about ad
|
@@ -25,7 +25,7 @@ module AdriverApi
|
|
25
25
|
h[:id] = response.body['entry']['content']['ad']['id']
|
26
26
|
h[:name] = response.body['entry']['content']['ad']['name']
|
27
27
|
h[:enable] = response.body['entry']['content']['ad']['enable']
|
28
|
-
h[:adplacements] = Array(response.body['entry']['content']['ad']['adPlacements']['href']).map{|x| x.split('/').last}
|
28
|
+
h[:adplacements] = Array.wrap(response.body['entry']['content']['ad']['adPlacements']['href']).map{|x| x.split('/').last}
|
29
29
|
h
|
30
30
|
end
|
31
31
|
|
@@ -34,7 +34,7 @@ module AdriverApi
|
|
34
34
|
response = make_request('adplacements', ad_id: ad_id)
|
35
35
|
return response if raw
|
36
36
|
#TODO: иногда массив, иногда строка
|
37
|
-
Array(response.body['feed']['entry']).map{|x| {id: x['content']['adPlacement']['id'], name: x['content']['adPlacement']['name'], banners: x['content']['adPlacement']['banners'] ? Array(x['content']['adPlacement']['banners']['href']).map{|x2| x2.split('/').last} : []} }
|
37
|
+
Array.wrap(response.body['feed']['entry']).map{|x| {id: x['content']['adPlacement']['id'], name: x['content']['adPlacement']['name'], banners: x['content']['adPlacement']['banners'] ? Array.wrap(x['content']['adPlacement']['banners']['href']).map{|x2| x2.split('/').last} : []} }
|
38
38
|
end
|
39
39
|
|
40
40
|
def banner(ban_id)
|
@@ -45,7 +45,7 @@ module AdriverApi
|
|
45
45
|
response = make_request("stat/banners/#{ban_id}", start_date: start_date, stop_date: stop_date, granularity: period)
|
46
46
|
return response if raw
|
47
47
|
h = {}
|
48
|
-
Array(response.body['entry']['content']['statObject']['stat']['item']).each{|x| h[x['date']] = {views: x['exp'], clicks: x['click']} }
|
48
|
+
Array.wrap(response.body['entry']['content']['statObject']['stat']['item']).each{|x| h[x['date']] = {views: x['exp'], clicks: x['click']} }
|
49
49
|
h
|
50
50
|
end
|
51
51
|
|
data/lib/adriver_api/version.rb
CHANGED
data/lib/adriver_api.rb
CHANGED