ravelin 0.1.8 → 0.1.9

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: cc46a8d84598d37d617b1849c308a07a3a9d6c80
4
- data.tar.gz: 89720381c525d4f99fa568cba498d3e9fd686bb6
3
+ metadata.gz: 874c8568169626855d02fb3f4792e2ebf7b5ee15
4
+ data.tar.gz: 4119a2786f38144b463410ab645d6259635f8526
5
5
  SHA512:
6
- metadata.gz: 43d94d6e7e32f017c18a5e38aaea8de8fc773fc1d57ca8199a4846ea388c91dbafd7058835de3646f648e009d6eb98f521cf37fafd0bc48fcde33205f849230a
7
- data.tar.gz: 173c6e1c612e48f0518720248c308a41c29e8b0098f55a2de8ed86e7aeb0b339f20a3767ca7e465d98716ef0914dfe9de1afac2ddc957fabe728d560e4ad1303
6
+ metadata.gz: e883f0bd98a2ae55114e9d44e0d6363c22507518df21f2769680932a757872a2713f45926ed5a19280522e6b405d4d84460dcb5545f4a93e499d650cea7deed3
7
+ data.tar.gz: 5324dc77ebc2c39163d2064ef2e1e236f2159a328f6daaacea73c70cc95111b25373a7b8ba0db0434497c01a0b8dbeeff627052fe1a1164892535e20fb235589
@@ -39,6 +39,12 @@ module Ravelin
39
39
  post("/v2/backfill/#{event.name}", event.serializable_hash)
40
40
  end
41
41
 
42
+ def send_tag(**args)
43
+ tag = Tag.new(**args)
44
+
45
+ post("/v2/tag/customer", tag.serializable_hash)
46
+ end
47
+
42
48
  private
43
49
 
44
50
  def post(url, payload)
@@ -0,0 +1,32 @@
1
+ module Ravelin
2
+ class Tag
3
+ def initialize(payload:)
4
+ @payload = convert_to_ravelin_objects(payload)
5
+ end
6
+
7
+ def serializable_hash
8
+ hash_map(payload) do |k, v|
9
+ k = Ravelin.camelize(k)
10
+
11
+ [k, v]
12
+ end
13
+ end
14
+
15
+ private
16
+
17
+ attr_accessor :payload
18
+
19
+ def convert_to_ravelin_objects(payload)
20
+ hash_map(payload) do |k, v|
21
+ k = k.to_sym
22
+ v = Ravelin.convert_ids_to_strings(k, v)
23
+
24
+ [k, v]
25
+ end
26
+ end
27
+
28
+ def hash_map(hash, &block)
29
+ Hash[hash.map { |k, v| block.call(k, v) }]
30
+ end
31
+ end
32
+ end
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
data/lib/ravelin.rb CHANGED
@@ -27,6 +27,7 @@ require 'ravelin/voucher_redemption'
27
27
  require 'ravelin/label'
28
28
 
29
29
  require 'ravelin/event'
30
+ require 'ravelin/tag'
30
31
  require 'ravelin/response'
31
32
  require 'ravelin/client'
32
33
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ravelin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Levy
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2017-07-10 00:00:00.000000000 Z
14
+ date: 2017-08-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -126,6 +126,7 @@ files:
126
126
  - lib/ravelin/pre_transaction.rb
127
127
  - lib/ravelin/ravelin_object.rb
128
128
  - lib/ravelin/response.rb
129
+ - lib/ravelin/tag.rb
129
130
  - lib/ravelin/three_d_secure.rb
130
131
  - lib/ravelin/transaction.rb
131
132
  - lib/ravelin/version.rb