voucherify 1.4.0 → 1.5.0

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: f5bb63b6752861158fe5bf8e4987956de16a839e
4
- data.tar.gz: d4b8822a452531daa4e85c94de8652b55bd32edd
3
+ metadata.gz: ab32fb5a0650b16dd836fbc41e59be5272d7358d
4
+ data.tar.gz: 3d3a5a4cc85849314797586012da463cc94d6531
5
5
  SHA512:
6
- metadata.gz: 10ea71d73be55ac3bd913b8651f54fa81c812b8f115a4170f8cb5e8c5b2f1c40c792530492a9bde4e77c2553699c995c5290a8041cb08416edd34b8af740a792
7
- data.tar.gz: d7ce430802905f0678e9313fa8785230377a6e0768ddb0680b17080af1a7ce6406895308649b484f0c0bd866e1899d072b5501707a589908b057cc639b76ea58
6
+ metadata.gz: d3cce151749b2ebf952472a655cc7302bebd0fc77d8de1902e069e0c4948bf9444923c541ffc630efe9bd9803894dabba7aee8a14ba4da2dcc972c96e736612f
7
+ data.tar.gz: 1568a91853d557b7bbe4ba948e65b4b7e65ac111e89c91fef9c2ef32e26664883ff42f16bd9122617aa747665baa348a8cdada44429a4081de33e2324bab6452
data/README.md CHANGED
@@ -46,6 +46,8 @@ API:
46
46
  |
47
47
  <a href="#segments-api">Segments</a>
48
48
  |
49
+ <a href="#events-api">Events</a>
50
+ |
49
51
  <a href="#utils">Utils</a>
50
52
  </p>
51
53
 
@@ -384,6 +386,18 @@ voucherify.segments.delete(id);
384
386
 
385
387
  ---
386
388
 
389
+ ### Events API
390
+ Methods are provided within `voucherify.events.*` namespace.
391
+
392
+ - [Events](#events)
393
+
394
+ #### [Create event]
395
+ ```ruby
396
+ voucherify.events.track(event, metadata, customer);
397
+ ```
398
+
399
+ ---
400
+
387
401
  ### Migration from 0.x
388
402
 
389
403
  Version 1.x of the SDK is not backwards compatible with versions 0.x.
@@ -472,6 +486,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
472
486
  Bug reports and pull requests are welcome on GitHub at https://github.com/rspective/voucherify-ruby-sdk.
473
487
 
474
488
  ## Changelog
489
+ - **2017-11-16** - `1.5.0` - Expose events API
475
490
  - **2017-05-07** - `1.4.0` - Segments, Validation rules, API Versioning
476
491
  - **2017-03-22** - `1.3.0` - improved error handling
477
492
  - **2017-01-04** - `1.2.0` - added [import vouchers](#import-vouchers) method.
@@ -551,3 +566,5 @@ The gem is available as open source under the terms of the [MIT License](http://
551
566
  [Create Segment]: https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#create-segment
552
567
  [Get Segment]: https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#get-segment
553
568
  [Delete Segment]: https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#delete-segment
569
+
570
+ [Events]: http://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#the-custom-event-object
@@ -3,6 +3,7 @@ require 'voucherify/client'
3
3
  require 'voucherify/service/campaigns'
4
4
  require 'voucherify/service/customers'
5
5
  require 'voucherify/service/distributions'
6
+ require 'voucherify/service/events'
6
7
  require 'voucherify/service/products'
7
8
  require 'voucherify/service/redemptions'
8
9
  require 'voucherify/service/segments'
@@ -55,6 +55,10 @@ module Voucherify
55
55
  Voucherify::Service::Segments.new(self)
56
56
  end
57
57
 
58
+ def events
59
+ Voucherify::Service::Events.new(self)
60
+ end
61
+
58
62
  def get(path, params = {})
59
63
  begin
60
64
  url = @backend_url + path
@@ -0,0 +1,19 @@
1
+ module Voucherify
2
+ module Service
3
+ class Events
4
+ attr_reader :client
5
+
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ def track(event, metadata, customer)
11
+ @client.post('/events', {
12
+ :event => event,
13
+ :metadata => metadata,
14
+ :customer => customer
15
+ }.to_json)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module Voucherify
2
- VERSION = '1.4.0'
2
+ VERSION = '1.5.0'
3
3
  end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voucherify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawelrychlik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
11
+ date: 2017-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.11'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.11'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: webmock
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.3.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.3.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rest-client
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.0'
83
83
  description:
@@ -87,9 +87,9 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - .gitignore
91
- - .rspec
92
- - .travis.yml
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".travis.yml"
93
93
  - Gemfile
94
94
  - LICENSE
95
95
  - README.md
@@ -104,6 +104,7 @@ files:
104
104
  - lib/voucherify/service/campaigns.rb
105
105
  - lib/voucherify/service/customers.rb
106
106
  - lib/voucherify/service/distributions.rb
107
+ - lib/voucherify/service/events.rb
107
108
  - lib/voucherify/service/products.rb
108
109
  - lib/voucherify/service/redemptions.rb
109
110
  - lib/voucherify/service/segments.rb
@@ -124,17 +125,17 @@ require_paths:
124
125
  - lib
125
126
  required_ruby_version: !ruby/object:Gem::Requirement
126
127
  requirements:
127
- - - '>='
128
+ - - ">="
128
129
  - !ruby/object:Gem::Version
129
130
  version: 2.0.0
130
131
  required_rubygems_version: !ruby/object:Gem::Requirement
131
132
  requirements:
132
- - - '>='
133
+ - - ">="
133
134
  - !ruby/object:Gem::Version
134
135
  version: '0'
135
136
  requirements: []
136
137
  rubyforge_project:
137
- rubygems_version: 2.0.14.1
138
+ rubygems_version: 2.5.2
138
139
  signing_key:
139
140
  specification_version: 4
140
141
  summary: Ruby SDK for Voucherify. More info on http://www.voucherify.io