access 2.0.55 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/access.rb +1 -0
- data/lib/access/product.rb +32 -0
- data/lib/access/product_group.rb +6 -11
- data/lib/access/response.rb +3 -2
- data/lib/access/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 190c815f0a7b20f8a5d4619fe2313adaff7e6de4
|
4
|
+
data.tar.gz: f9992621bf7b304a81c76ead57b5e97453dd113a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6887426697922b8dce90212dbbd9607ec4d6628b191be94de508da481edd022893c9d054b48c40e6601fbe8c45ad648901317c2c8d8fad1f80384f94559f9f85
|
7
|
+
data.tar.gz: bae6eceac3ee10cad3b2ae9b1cf5f7373d236ddf996c0f5c41c32ca179073bd13100ccc1b58b3e21f1be7db834c6e84e13612fec454adab888a38bb263b0796c
|
data/Gemfile.lock
CHANGED
data/lib/access.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
module Access
|
2
|
+
class Product
|
3
|
+
include Access::MuchMeta
|
4
|
+
|
5
|
+
attr_reader :store, :location
|
6
|
+
|
7
|
+
def self.process_batch(chunk)
|
8
|
+
chunk.map { |product| new(product) }
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(values)
|
12
|
+
@used_fields = []
|
13
|
+
set_up_methods(values)
|
14
|
+
set_values(values)
|
15
|
+
@offer = Access::Offer.new(@offer) if @offer
|
16
|
+
@offer_store = Access::Store.new(@offer_store) if @offer_store
|
17
|
+
@categories = Access::Category.process_batch(@categories) if @categories
|
18
|
+
@links = Access::Link.new(@links) if @links
|
19
|
+
@offer_store = Access::Store.new(@offer_store) if @offer_store
|
20
|
+
@offer_uses_remaining = Access::Redemption.new(@offer_uses_remaining) if @offer_uses_remaining
|
21
|
+
end
|
22
|
+
|
23
|
+
def location
|
24
|
+
@offer_store.physical_location
|
25
|
+
end
|
26
|
+
|
27
|
+
def store
|
28
|
+
@offer_store
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
data/lib/access/product_group.rb
CHANGED
@@ -2,17 +2,6 @@ module Access
|
|
2
2
|
class ProductGroup
|
3
3
|
include Access::MuchMeta
|
4
4
|
|
5
|
-
def initialize(values)
|
6
|
-
@used_fields = []
|
7
|
-
set_up_methods(values)
|
8
|
-
set_values(values)
|
9
|
-
# @categories = Access::Category.process_batch(@categories) if @categories
|
10
|
-
# @links = Access::Link.new(@links) if @links
|
11
|
-
# @offer_store = Access::Store.new(@offer_store) if @offer_store
|
12
|
-
# @offer_uses_remaining = Access::Redemption.new(@offer_uses_remaining) if @offer_uses_remaining
|
13
|
-
end
|
14
|
-
|
15
|
-
|
16
5
|
def self.search(options = {})
|
17
6
|
Access::Api.new.search_product_groups options
|
18
7
|
end
|
@@ -21,6 +10,12 @@ module Access
|
|
21
10
|
chunk.map { |product_group| new(product_group) }
|
22
11
|
end
|
23
12
|
|
13
|
+
def initialize(values)
|
14
|
+
@used_fields = []
|
15
|
+
set_up_methods(values)
|
16
|
+
set_values(values)
|
17
|
+
@products = Access::Product.process_batch(@products) if @products
|
18
|
+
end
|
24
19
|
|
25
20
|
end
|
26
21
|
end
|
data/lib/access/response.rb
CHANGED
@@ -4,7 +4,7 @@ module Access
|
|
4
4
|
#basics
|
5
5
|
attr_reader :info, :links, :message, :status, :success, :error, :response_status, :dev_node, :internal_details, :response
|
6
6
|
#resources
|
7
|
-
attr_reader :offers, :stores, :locations, :categories, :suggestions, :oauth_applications, :access_tokens, :oauth_tokens, :oauth_token, :verify, :reports, :members, :filters, :oauth_access_token, :users, :offer_redemptions, :favorites, :campaigns, :channels, :spots, :programs, :devices, :product_groups
|
7
|
+
attr_reader :offers, :stores, :locations, :categories, :suggestions, :oauth_applications, :access_tokens, :oauth_tokens, :oauth_token, :verify, :reports, :members, :filters, :oauth_access_token, :users, :offer_redemptions, :favorites, :campaigns, :channels, :spots, :programs, :devices, :product_groups, :products
|
8
8
|
#aggregations
|
9
9
|
attr_reader :offer_count_in_categories, :offer_count_by_redemption_method, :offer_count_by_facet, :custom_aggregation
|
10
10
|
#redemptions
|
@@ -64,7 +64,8 @@ module Access
|
|
64
64
|
|
65
65
|
class ProductGroupResponse < Response
|
66
66
|
def process_data
|
67
|
-
|
67
|
+
(@product_groups = []; create_error) if @message
|
68
|
+
@product_groups = Access::ProductGroup.process_batch(@product_groups) if @product_groups
|
68
69
|
end
|
69
70
|
end
|
70
71
|
|
data/lib/access/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: access
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eggett
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-01-
|
13
|
+
date: 2017-01-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -255,6 +255,7 @@ files:
|
|
255
255
|
- lib/access/oauth_application.rb
|
256
256
|
- lib/access/offer.rb
|
257
257
|
- lib/access/organization.rb
|
258
|
+
- lib/access/product.rb
|
258
259
|
- lib/access/product_group.rb
|
259
260
|
- lib/access/program.rb
|
260
261
|
- lib/access/redeem.rb
|