affiliation-api-client 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/affiliation-api/merchant.rb +19 -2
- data/lib/affiliation-api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 87d7a4e8b41aaf159e6ed22ae6d65e28f9125343
|
|
4
|
+
data.tar.gz: 55822f453599ae315c501fe56bc483b78de159b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aab67f45a54209efcc7b7810c5e166b35f623b35b0b8d8c341d6e95bd84c475739a818099e39285d8be85e9857705378e15864b79ef2feb38956ff7563a75153
|
|
7
|
+
data.tar.gz: 9cc9185b1e954969be65bb4023529c30a51ce43847cb9a88a277c24090a6d98d4346b7afcd896e11fcf782e417597d5c4d692fa76f4c8a2c414e5c1830221684
|
|
@@ -13,7 +13,10 @@ module AffiliationApi
|
|
|
13
13
|
:category_ids,
|
|
14
14
|
:reward_percentage,
|
|
15
15
|
:reward_fixed,
|
|
16
|
-
:reward_details
|
|
16
|
+
:reward_details,
|
|
17
|
+
:primary_ad,
|
|
18
|
+
:primary_ad_id,
|
|
19
|
+
:ads
|
|
17
20
|
|
|
18
21
|
def network_updated_at
|
|
19
22
|
return nil unless @network_updated_at.present?
|
|
@@ -22,8 +25,22 @@ module AffiliationApi
|
|
|
22
25
|
|
|
23
26
|
def categories
|
|
24
27
|
@categories['data'].map do |cat_data|
|
|
25
|
-
Category.new
|
|
28
|
+
Category.new cat_data
|
|
26
29
|
end
|
|
27
30
|
end
|
|
31
|
+
|
|
32
|
+
def primary_ad
|
|
33
|
+
Ad.new @primary_ad['data']
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def ads
|
|
37
|
+
@ads['data'].map do |ad_data|
|
|
38
|
+
Ad.new ad_data
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def primary_ad_id
|
|
43
|
+
@primary_ad_id || primary_ad.id || ads.first.try(:id)
|
|
44
|
+
end
|
|
28
45
|
end
|
|
29
46
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: affiliation-api-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chaker Nakhli
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-01-
|
|
11
|
+
date: 2016-01-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: api-resource
|