customerx_tracking 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ceee53bb5d65683ec44c7b0b118bddf7172bba14cc3c2a73b99fafb871588891
4
- data.tar.gz: 0d87763568c2364303c64a566d6e7d1125f360b86d5db8bae7e01d2b91d106ba
3
+ metadata.gz: f9b3ae9f0cfcbe45349c526e4a297800dc868d6ae707ad0731df6f51f579fa5e
4
+ data.tar.gz: 8b18d6856d5f4fea1ba7ba4557046ac0a273d4046e8e217b4b42d3ce8a627d66
5
5
  SHA512:
6
- metadata.gz: b0cb1964041a0096cd81483ac0564be5a38be6cbe91c21a3aa84d5bd69ce97ad8e23ab0771f100b6a5f41e27fd58726221387fc50c745e804d53431e5e5be7d4
7
- data.tar.gz: cf8dcc3f50f3d4a23630e620d61795eadf68172ccbd31375166debfd2bf4ddc7f10462548461c898ea328ab0969e72cb6c6a236e2ffdd31285fb2f0661381a31
6
+ metadata.gz: 5dfc1a8a3cdee7fb6cf70f540effa5fb8c5060bbae48fb657180955680ad97e827d3e21a64030baf3132605772c1c2f9ef8b8eafb23bf674e913744d9b8d35cc
7
+ data.tar.gz: 274f9f3dcf1e1b5e35be9c1a952d4c48f22dc83733df4c4eb3869a17446d2d71b1b72500d5e2694c3c7cd443ec9f9b02614d8894be535fde4064e59a7fa31fee
@@ -5,7 +5,7 @@ module CustomerxTracking
5
5
  end
6
6
 
7
7
  def authorizations_is_not_present?
8
- ::CustomerxTracking.authorization.nil? && (::CustomerxTracking.credential.nil? || ::CustomerxTracking.key.nil?)
8
+ ::CustomerxTracking.credential.nil? || ::CustomerxTracking.key.nil?
9
9
  end
10
10
 
11
11
  private
@@ -13,19 +13,12 @@ module CustomerxTracking
13
13
  def faraday_options
14
14
  {
15
15
  headers: {
16
- 'Content-Type' => 'application/json'
17
- }.merge(validate_authorization),
16
+ 'Content-Type' => 'application/json',
17
+ 'credential' => CustomerxTracking.credential,
18
+ 'key'=> CustomerxTracking.key
19
+ },
18
20
  url: ::CustomerxTracking.base_url
19
21
  }
20
22
  end
21
-
22
- def validate_authorization
23
- return { authorization: ::CustomerxTracking.authorization } unless ::CustomerxTracking.authorization.nil?
24
-
25
- {
26
- credential: ::CustomerxTracking.credential,
27
- key: ::CustomerxTracking.key
28
- }
29
- end
30
23
  end
31
24
  end
@@ -2,14 +2,13 @@ module CustomerxTracking
2
2
  class Requestor < Base
3
3
  def initialize
4
4
  super
5
- raise 'authorization or credential and key should be set' if authorizations_is_not_present?
5
+ raise 'credential and key should be set' if authorizations_is_not_present?
6
6
  end
7
7
 
8
8
  def request(meth, params = nil)
9
9
  meth = meth.downcase
10
10
 
11
11
  begin
12
- p JSON.parse(params.to_json)
13
12
  response = connection.method(meth).call do |req|
14
13
  (meth == :get ? (req.params = params) : (req.body = params.to_json)) if params
15
14
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CustomerxTracking
4
- VERSION = '2.1.1'
4
+ VERSION = '2.2.0'
5
5
  end
@@ -28,14 +28,6 @@ module CustomerxTracking
28
28
  def self.key=(key)
29
29
  @key = key
30
30
  end
31
-
32
- def self.authorization
33
- @authorization
34
- end
35
-
36
- def self.authorization=(authorization)
37
- @authorization = authorization
38
- end
39
31
  end
40
32
 
41
33
  require 'faraday'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: customerx_tracking
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Grassi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-14 00:00:00.000000000 Z
11
+ date: 2022-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -43,7 +43,7 @@ licenses:
43
43
  metadata:
44
44
  bug_tracker_uri: https://github.com/CustomerX-CX/customerx_tracking_client_rb/issues
45
45
  changelog_uri: https://github.com/CustomerX-CX/customerx_tracking_client_rb/blob/master/CHANGELOG.md
46
- releases_uri: https://github.com/CustomerX-CX/customerx_tracking_client_rb/releases/tag/2.1.1
46
+ releases_uri: https://github.com/CustomerX-CX/customerx_tracking_client_rb/releases/tag/2.2.0
47
47
  post_install_message:
48
48
  rdoc_options: []
49
49
  require_paths:
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  - !ruby/object:Gem::Version
60
60
  version: 1.3.6
61
61
  requirements: []
62
- rubygems_version: 3.2.22
62
+ rubygems_version: 3.2.3
63
63
  signing_key:
64
64
  specification_version: 4
65
65
  summary: CustomerX Tracking REST API Client