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 +4 -4
- data/lib/ravelin/client.rb +6 -0
- data/lib/ravelin/tag.rb +32 -0
- data/lib/ravelin/version.rb +1 -1
- data/lib/ravelin.rb +1 -0
- 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: 874c8568169626855d02fb3f4792e2ebf7b5ee15
|
4
|
+
data.tar.gz: 4119a2786f38144b463410ab645d6259635f8526
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e883f0bd98a2ae55114e9d44e0d6363c22507518df21f2769680932a757872a2713f45926ed5a19280522e6b405d4d84460dcb5545f4a93e499d650cea7deed3
|
7
|
+
data.tar.gz: 5324dc77ebc2c39163d2064ef2e1e236f2159a328f6daaacea73c70cc95111b25373a7b8ba0db0434497c01a0b8dbeeff627052fe1a1164892535e20fb235589
|
data/lib/ravelin/client.rb
CHANGED
data/lib/ravelin/tag.rb
ADDED
@@ -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
|
data/lib/ravelin/version.rb
CHANGED
data/lib/ravelin.rb
CHANGED
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.
|
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-
|
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
|