vauchar_api 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9c8318654d4b3e2a5520e5cf5d169f3bf50db9292360fb17c0e2b4686d7b0a6
4
- data.tar.gz: ad16c7b9e8f19bb057b6fef215dc20e8d2b6262a92e6ed3dad4f94f662d12ad0
3
+ metadata.gz: ca991c1ab76d8d3e2464fb32b4ec63ab76cc4baa11371e052817b03b60715af3
4
+ data.tar.gz: a87c2247cb81c23723f1590f6b2b9408097762d089d645029e6899c8e1854c82
5
5
  SHA512:
6
- metadata.gz: 9b002ed2e80bbd21e97104cc3f709f8e160f53319c9d29db8e9f32438406f0c8e267e5e1bacaaab779dc8cac769a2b9bc00a82ac11a3be638df0dee0f0110d6d
7
- data.tar.gz: f636e86832b27cbd797b65e240a02080f8a630008533ae28b9fb10239e954b46a657801c3c50da593a725ab43dd856b74ea5366036b1e5d41f30225d9553e0ba
6
+ metadata.gz: 3068b1ae68b10c1c13a7dd78345a7503b12775e52315f4f535ccefa3e32183aa5bc35cd154aadcb691dc669d349a01dc834067ed294832ced237e3a8a9344462
7
+ data.tar.gz: d7a328c998a16e556c9617a7331b962271fa4c1995e999622d96a64b82df09e2f32137f687a7beb8b1ef356d649ff3830caa7d8e7f0fa59cf657b0f41bfa66dd
@@ -23,6 +23,11 @@ module VaucharAPI
23
23
  # Delete
24
24
  # customer = VaucharAPI::Customer.find("cust-15507323535c6e4c416c697")
25
25
  # customer.destroy
26
+ #
27
+ # Redemptions
28
+ # customer = VaucharAPI::Customer.find("cust-15507323535c6e4c416c697")
29
+ # result = customer.redemptions("en-deal-15499589715c627f3b57837")
30
+ # result.voucher.voucher_code # => "DA2C2J65JFVNY"
26
31
 
27
32
  class Customer < Base
28
33
  def accepts_attributes
@@ -30,5 +35,10 @@ module VaucharAPI
30
35
  accepts.push :user_id if self.new?
31
36
  accepts
32
37
  end
38
+
39
+ def redemptions(deal_id)
40
+ resource = post("deals/#{deal_id}/redemptions", {}, only_id)
41
+ self.class.format.decode(resource.body)
42
+ end
33
43
  end
34
44
  end
@@ -14,5 +14,11 @@ module VaucharAPI
14
14
  # team.destroy
15
15
 
16
16
  class Team < Base
17
+ def redeem(voucher_id)
18
+ keep_prefix_options do
19
+ resource = post("redeem/vouchers/#{voucher_id}", {}, only_id)
20
+ self.class.format.decode(resource.body)
21
+ end
22
+ end
17
23
  end
18
24
  end
@@ -1,3 +1,3 @@
1
1
  module VaucharAPI
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vauchar_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max