parallel588-klaviyo 0.14.5 → 0.14.8
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 +2 -3
- data/lib/klaviyo/resource.rb +4 -3
- data/lib/klaviyo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7454b19b704b2ad3acb1fe4ccfea6bc87507b35e926473ccd2b30cfc77a3d3b
|
4
|
+
data.tar.gz: 0a3c1a8ff4d3157e787560c0b1f11f96ed1fcb7beed4ca091f18a7fcd44ea41b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '058c25e668e6b50673a8aea2e0bca26c8e54d9f51e9db713cd79ba70ef9798993e833ba75186604cbbddc5a75f0f241ccc5fe998a787814da063b0b362a8ee19'
|
7
|
+
data.tar.gz: 66cc1f0e7e909003b75db74cdc95ddc1c3d59b8fe654c1f05aedaba09cfa074f697ddb52816c37ed9ef92d9bc463ec3107676ce7babab97a75ecef0214422f9f
|
data/lib/klaviyo/client.rb
CHANGED
@@ -14,9 +14,8 @@ module Klaviyo
|
|
14
14
|
raise Errors::AuthenticationError, 'No Token provided.' unless @token
|
15
15
|
|
16
16
|
@conn = Faraday.new(default_req_options.merge(req_options)) do |f|
|
17
|
-
f.
|
18
|
-
|
19
|
-
f.request :url_encoded
|
17
|
+
f.request :url_encoded
|
18
|
+
|
20
19
|
f.use Errors::RequestError
|
21
20
|
f.adapter Faraday.default_adapter
|
22
21
|
end
|
data/lib/klaviyo/resource.rb
CHANGED
@@ -21,7 +21,8 @@ module Klaviyo
|
|
21
21
|
|
22
22
|
attr_reader :meta, :items
|
23
23
|
|
24
|
-
def initialize(
|
24
|
+
def initialize(raw_data)
|
25
|
+
data = raw_data.is_a?(String) ? MultiJson.load(raw_data) : raw_data
|
25
26
|
@items = data.delete('data').map { |attrs| Klaviyo::Resource.build(attrs) }
|
26
27
|
@meta = data
|
27
28
|
end
|
@@ -36,8 +37,8 @@ module Klaviyo
|
|
36
37
|
class Folder < KlaviyoObject; end
|
37
38
|
class Membership < KlaviyoObject; end
|
38
39
|
|
39
|
-
def self.build(
|
40
|
-
|
40
|
+
def self.build(params)
|
41
|
+
attrs = params.is_a?(String) ? MultiJson.load(params) : params
|
41
42
|
object = attrs.delete('object')
|
42
43
|
case object.to_s
|
43
44
|
when 'person'
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Pechnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|