api_six_client 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/api_six_client/base.rb +20 -5
- data/lib/api_six_client/base_int.rb +3 -4
- data/lib/api_six_client/base_v2.rb +3 -4
- data/lib/api_six_client/base_v2_int.rb +3 -4
- data/lib/api_six_client/version.rb +1 -1
- data/lib/api_six_client.rb +1 -0
- 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: c8489c55dbd23fe027439ff87773f8671c306c5ffde70a2e32bd64ca6bbda017
|
4
|
+
data.tar.gz: 5ef40b78d82414ebb57239cef2ffc7dc09e3d4dc7ddfc57c0fc2722f4ecff9d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91126434e2749312639c995f30b21c18f4f4c61ca186fce546df9603fd04c126970903b46d27c16c23dbece402edc0b3a853fa59e332b11e2cf5db83c0effe49
|
7
|
+
data.tar.gz: 29d014f303f6b3347431352f3772fa2d26040f293cd8dbfa707984723e8adecc1dc9b24261d199d698cb25bb33638e93a832162530e487c59253417314b88d16
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
api_six_client (1.4.
|
4
|
+
api_six_client (1.4.4)
|
5
5
|
faraday (~> 2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
faraday (2.7.
|
10
|
+
faraday (2.7.10)
|
11
11
|
faraday-net_http (>= 2.0, < 3.1)
|
12
12
|
ruby2_keywords (>= 0.0.4)
|
13
13
|
faraday-net_http (3.0.2)
|
data/lib/api_six_client/base.rb
CHANGED
@@ -7,12 +7,13 @@ module ApiSixClient
|
|
7
7
|
class Base
|
8
8
|
attr_reader :endpoint
|
9
9
|
|
10
|
-
def initialize(endpoint: nil, auth_token: nil)
|
11
|
-
@endpoint = endpoint
|
12
|
-
@auth_token = auth_token
|
10
|
+
def initialize(endpoint: nil, auth_token: nil, debug_mode: false)
|
11
|
+
@endpoint = endpoint
|
12
|
+
@auth_token = auth_token
|
13
|
+
@debug_mode = debug_mode
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
override_defaults
|
16
|
+
validate_config!
|
16
17
|
end
|
17
18
|
|
18
19
|
def post(path, params = {}, headers = {})
|
@@ -35,8 +36,20 @@ module ApiSixClient
|
|
35
36
|
request __method__, path, params, headers
|
36
37
|
end
|
37
38
|
|
39
|
+
protected
|
40
|
+
|
41
|
+
def override_defaults
|
42
|
+
@endpoint ||= ApiSixClient.config.endpoint_int
|
43
|
+
@auth_token ||= ApiSixClient.config.auth_token_int
|
44
|
+
end
|
45
|
+
|
38
46
|
private
|
39
47
|
|
48
|
+
def validate_config!
|
49
|
+
raise Errors::EndpointIsEmpty unless @endpoint
|
50
|
+
raise Errors::AuthTokenIsEmpty unless @auth_token
|
51
|
+
end
|
52
|
+
|
40
53
|
def service_path
|
41
54
|
self.class.name.demodulize.underscore
|
42
55
|
end
|
@@ -61,6 +74,8 @@ module ApiSixClient
|
|
61
74
|
|
62
75
|
faraday.request :url_encoded
|
63
76
|
faraday.adapter :net_http
|
77
|
+
|
78
|
+
faraday.response :logger, ::Logger.new(STDOUT), bodies: true if @debug_mode
|
64
79
|
end
|
65
80
|
end
|
66
81
|
end
|
@@ -2,12 +2,11 @@
|
|
2
2
|
|
3
3
|
module ApiSixClient
|
4
4
|
class BaseInt < Base
|
5
|
-
|
5
|
+
protected
|
6
|
+
|
7
|
+
def override_defaults
|
6
8
|
@endpoint = ApiSixClient.config.endpoint_int
|
7
9
|
@auth_token = ApiSixClient.config.auth_token_int
|
8
|
-
|
9
|
-
raise Errors::EndpointIsEmpty unless @endpoint
|
10
|
-
raise Errors::AuthTokenIsEmpty unless @auth_token
|
11
10
|
end
|
12
11
|
end
|
13
12
|
end
|
@@ -2,12 +2,11 @@
|
|
2
2
|
|
3
3
|
module ApiSixClient
|
4
4
|
class BaseV2 < Base
|
5
|
-
|
5
|
+
protected
|
6
|
+
|
7
|
+
def override_defaults
|
6
8
|
@endpoint = ApiSixClient.config.endpoint_v2
|
7
9
|
@auth_token = ApiSixClient.config.auth_token_v2
|
8
|
-
|
9
|
-
raise Errors::EndpointIsEmpty unless @endpoint
|
10
|
-
raise Errors::AuthTokenIsEmpty unless @auth_token
|
11
10
|
end
|
12
11
|
end
|
13
12
|
end
|
@@ -2,12 +2,11 @@
|
|
2
2
|
|
3
3
|
module ApiSixClient
|
4
4
|
class BaseV2Int < Base
|
5
|
-
|
5
|
+
protected
|
6
|
+
|
7
|
+
def override_defaults
|
6
8
|
@endpoint = ApiSixClient.config.endpoint_v2_int
|
7
9
|
@auth_token = ApiSixClient.config.auth_token_v2_int
|
8
|
-
|
9
|
-
raise Errors::EndpointIsEmpty unless @endpoint
|
10
|
-
raise Errors::AuthTokenIsEmpty unless @auth_token
|
11
10
|
end
|
12
11
|
end
|
13
12
|
end
|
data/lib/api_six_client.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_six_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Dobrorodnov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|