parallel588-klaviyo 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/klaviyo/client.rb +9 -7
- data/lib/klaviyo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd713893e13f58338e0f9df2ce566100a3e84259
|
4
|
+
data.tar.gz: 9a995f974fe74f0d2d739ffc02b65b1b62967dcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c1c6715230ff4946a7f7f61098185bdcc5b3b280efc065ee0c4673e794fc4db4036ae2b3170493d6f762a783e48fe3aaaa2a153ee4d43c91add00e401e4f1e9
|
7
|
+
data.tar.gz: e433a34bb5a90b7dbb8068ee5bf6dea16b176c8c56745f8bfa1e4540bd403aedd942d1a10a0c519bc0a751eb416d1caf6b07108212d2f5714fab5887398344e2
|
data/lib/klaviyo/client.rb
CHANGED
@@ -7,18 +7,13 @@ module Klaviyo
|
|
7
7
|
extend ClientDSL
|
8
8
|
|
9
9
|
attr_reader :api_key, :conn, :token
|
10
|
-
def initialize(api_key, token)
|
10
|
+
def initialize(api_key, token, req_options = {})
|
11
11
|
@api_key = api_key
|
12
12
|
@token = token
|
13
|
-
|
14
13
|
raise Errors::AuthenticationError, 'No API key provided.' unless @api_key
|
15
14
|
raise Errors::AuthenticationError, 'No Token provided.' unless @token
|
16
15
|
|
17
|
-
|
18
|
-
@conn = Faraday.new(
|
19
|
-
url: API_ENDPOINT,
|
20
|
-
ssl: { ca_path: Klaviyo::DEFAULT_CA_BUNDLE_PATH }
|
21
|
-
) do |f|
|
16
|
+
@conn = Faraday.new(default_req_options.merge(req_options)) do |f|
|
22
17
|
f.headers['Accept'] = 'application/json'
|
23
18
|
f.request :url_encoded
|
24
19
|
f.response :logger
|
@@ -79,6 +74,13 @@ module Klaviyo
|
|
79
74
|
|
80
75
|
private
|
81
76
|
|
77
|
+
def default_req_options
|
78
|
+
{
|
79
|
+
url: API_ENDPOINT,
|
80
|
+
ssl: { ca_path: Klaviyo::DEFAULT_CA_BUNDLE_PATH }
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
82
84
|
def constantize(class_name)
|
83
85
|
Object.module_eval(
|
84
86
|
class_name.to_s.gsub(/\/(.?)/) {
|
data/lib/klaviyo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel588-klaviyo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Pechnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|