affiliation-api-client 0.1.12 → 0.1.13

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: 42f647f1438bc6fb6b0ea5aa05f7b029c12e87f9
4
- data.tar.gz: 429161f66df054f6831ff7a134b8676d2f9a1b2a
3
+ metadata.gz: b6b86411265d4d6271ba899621412cc6b2109a07
4
+ data.tar.gz: 677c1ee738b06e08bb788fe74f55399d392367d5
5
5
  SHA512:
6
- metadata.gz: db9f88a132b85fd5e50088942dbc3676ae89f80702ae433c1f8401479c7e042045041c0f0bdb9b69de95cd0a552c0e3eaac052f61900fb8fd6d2b041d49167c0
7
- data.tar.gz: 010fd14589e8954ff830db5d95579cd57f516b2dad874e18637c845b0cd03de83d567e51cb66ed612178cf3e9d2a4d31bb71746ff873281e387bbfa9ed32b918
6
+ metadata.gz: a848fd05f3587a74a75bab6e0e07ea650c2b8d9714f1909dd0629b698e881416ed786e4adda38325eb5a81e5c50114f98c1562717466d747b61e3768e815c7fd
7
+ data.tar.gz: 5636ba97e924cf6db9e93e50a6cbf15fbd8d3befb843d00ad1b0293721f651b67b0db4c0926e0b70d62b9111f1271adb3558507aeb0b1a009882be32a99c1084
@@ -0,0 +1,50 @@
1
+ module AffiliationApi
2
+ class Program < AffiliationApi::Resource
3
+ attr_accessor :id,
4
+ :name,
5
+ :description,
6
+ :url,
7
+ :image,
8
+ :image_url,
9
+ :hidden,
10
+ :network_name,
11
+ :ad_space_name,
12
+ :network_status,
13
+ :network_updated_at,
14
+ :network_data,
15
+ :needs_review,
16
+ :categories,
17
+ :category_ids,
18
+ :reward_percentage,
19
+ :reward_fixed,
20
+ :reward_details,
21
+ :primary_ad,
22
+ :primary_ad_id,
23
+ :ads
24
+
25
+ def network_updated_at
26
+ return nil unless @network_updated_at.present?
27
+ Time.parse(@network_updated_at)
28
+ end
29
+
30
+ def categories
31
+ @categories['data'].map do |cat_data|
32
+ Category.new cat_data
33
+ end
34
+ end
35
+
36
+ def primary_ad
37
+ Ad.new @primary_ad['data']
38
+ end
39
+
40
+ def ads
41
+ @ads['data'].map do |ad_data|
42
+ Ad.new ad_data
43
+ end
44
+ end
45
+
46
+ def primary_ad_id
47
+ @primary_ad_id || primary_ad.id || ads.first.try(:id)
48
+ end
49
+ end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module AffiliationApi
2
- VERSION = '0.1.12'
2
+ VERSION = '0.1.13'
3
3
  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.12
4
+ version: 0.1.13
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-02-17 00:00:00.000000000 Z
11
+ date: 2016-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: api-resource
@@ -96,6 +96,7 @@ files:
96
96
  - lib/affiliation-api/merchant.rb
97
97
  - lib/affiliation-api/merchant_version.rb
98
98
  - lib/affiliation-api/offer.rb
99
+ - lib/affiliation-api/program.rb
99
100
  - lib/affiliation-api/resource.rb
100
101
  - lib/affiliation-api/sale.rb
101
102
  - lib/affiliation-api/version.rb