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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8270758896d9a143f8901da1da5fcd0ef0b92d13321a4a5925e7d8a634bf980
4
- data.tar.gz: 865c0fdf3cc4605f942e16cdec1a19fe3466179a64bef0e44ec532b1ecfe09e2
3
+ metadata.gz: a7454b19b704b2ad3acb1fe4ccfea6bc87507b35e926473ccd2b30cfc77a3d3b
4
+ data.tar.gz: 0a3c1a8ff4d3157e787560c0b1f11f96ed1fcb7beed4ca091f18a7fcd44ea41b
5
5
  SHA512:
6
- metadata.gz: fd09cbfe084e0c9b5f3bf220bc42c99e25890f068e8b80ffd9115008215890bc5d33c567ba5a61355372923a33aebe576203c37623b469d33ac7e066317d6817
7
- data.tar.gz: ae5c13bbe9b61c2a8787eb27342e2a3b732ab5bbc6792c27ca4baeca566da7bdb6fb6806108e0795681040bc2085c1574874e01477cbcce1a0822b3b46223af7
6
+ metadata.gz: '058c25e668e6b50673a8aea2e0bca26c8e54d9f51e9db713cd79ba70ef9798993e833ba75186604cbbddc5a75f0f241ccc5fe998a787814da063b0b362a8ee19'
7
+ data.tar.gz: 66cc1f0e7e909003b75db74cdc95ddc1c3d59b8fe654c1f05aedaba09cfa074f697ddb52816c37ed9ef92d9bc463ec3107676ce7babab97a75ecef0214422f9f
@@ -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.headers['Accept'] = 'application/json'
18
- f.headers[:content_type] = 'application/json'
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
@@ -21,7 +21,8 @@ module Klaviyo
21
21
 
22
22
  attr_reader :meta, :items
23
23
 
24
- def initialize(data)
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(attrs)
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'
@@ -1,3 +1,3 @@
1
1
  module Klaviyo
2
- VERSION = "0.14.5"
2
+ VERSION = "0.14.8"
3
3
  end
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.5
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-10-03 00:00:00.000000000 Z
11
+ date: 2018-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus