api_six_client 1.4.3 → 1.4.5
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 +3 -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: 6b4c5436c7806404e8ad5f25a8746065e2071886bd841598325bf5f1728d4a3c
|
4
|
+
data.tar.gz: '063028f67d0e712ec808ff9b2b87943a4db8af889e7bebd6a3b5fea409cea80f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c8a6c4cd94202197ef126c7b27876474bab8fe706447bab1ed5d3dead71823a2c0eda0c58ca62d12970890df4ee6e043b6c5b68fbd70646568e7c3201bb7e70
|
7
|
+
data.tar.gz: c1c2c46194ae62ec587258c789434ba02628d5f1bd5df9d7e7905e0b27fb2d3db87801358ea849a7b0b47bf60b9de68116712f71237314b1e514f8d212a50fa4
|
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.5)
|
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.5
|
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-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|