centaman 0.1.11 → 0.1.12

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: b3712d7fef5805f8fef3c8b011513e0161b4cd30
4
- data.tar.gz: 31b91a48a5bf745764fde81f6333b09cf056b42d
3
+ metadata.gz: 0cde2e6adc04f9973174dbba7176bd1a417f099e
4
+ data.tar.gz: a24565413fb3271ba07556192bb13e90fbe17347
5
5
  SHA512:
6
- metadata.gz: 0fd637dabe42ba80b6ec0c4834953c76bfe6528617e72115d3a8c148d87279174c768d9732ff99f668d65d2abf0d1b4089e9246a6081f97493d897c37cc31fd5
7
- data.tar.gz: 36b7a09d8737f5f83aba35e8895a3d272365ed461fc0a31db44c48e30d82ab8a59e2aab643d0e38b2e8ac07518a6848f62e11bc1457bb16fcd4c7d5cc04742da
6
+ metadata.gz: 23c170fc6655fd2988eb32cb8fdbaa34dc4cf649b0863396a98037b23ec4094f8d34cde8933998b85b783efb40945bca2aa80d76f64c931c2a222de41afb65d9
7
+ data.tar.gz: 16451629d3b3fae84838810d795d0b9badab33071c147c8c0e80305bc3f56e73aa83f5bfcf70985f09d72835b7a0a93d2ef033ad424e98b4a04df74edea28dcd
Binary file
@@ -20,6 +20,7 @@ module Centaman
20
20
  app_key: :coupon_code,
21
21
  type: :integer
22
22
  ),
23
+
23
24
  Centaman::Attribute.new(
24
25
  centaman_key: 'LimitedUse',
25
26
  app_key: :limited_use,
@@ -1,10 +1,11 @@
1
1
  module Centaman
2
2
  class Service::CouponCheck < Centaman::Service
3
3
  include Centaman::JsonWrapper
4
- attr_reader :coupon_code
4
+ attr_reader :coupon_code, :product_area
5
5
 
6
6
  def after_init(args)
7
7
  @coupon_code = args[:coupon_code]
8
+ @product_area = args[:product_area]
8
9
  require_args
9
10
  end
10
11
 
@@ -19,12 +20,16 @@ module Centaman
19
20
  def options_hash
20
21
  {
21
22
  'CouponCode' => coupon_code,
22
- 'ProductArea' => 'TimedTickets'
23
+ 'ProductArea' => product_area
23
24
  }.to_json
24
25
  end
25
26
 
27
+ def required_fields
28
+ [coupon_code, product_area]
29
+ end
30
+
26
31
  def require_args
27
- raise "coupon_code is required for #{self.class.name}" if coupon_code.nil?
32
+ raise "coupon_code and product_area required for #{self.class.name}" if required_fields.include?(nil)
28
33
  end
29
34
  end
30
35
  end
@@ -1,3 +1,3 @@
1
1
  module Centaman
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: centaman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - francirp
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-09-18 00:00:00.000000000 Z
12
+ date: 2017-10-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -85,6 +85,7 @@ files:
85
85
  - bin/console
86
86
  - bin/setup
87
87
  - centaman.gemspec
88
+ - dump.rdb
88
89
  - lib/centaman.rb
89
90
  - lib/centaman/attribute.rb
90
91
  - lib/centaman/exceptions.rb