api_six_client 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/api_six_client/base.rb +7 -3
- data/lib/api_six_client/base_int.rb +13 -0
- data/lib/api_six_client/base_v2.rb +13 -0
- data/lib/api_six_client/config.rb +2 -5
- data/lib/api_six_client/version.rb +1 -1
- data/lib/api_six_client.rb +4 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52c00571c9d3b9758a69a4c174003efdae2a000ad40e4c75f567f1cd7ac262da
|
4
|
+
data.tar.gz: 4b81a7b3bdb336611a1c7785892e0882ce44ea5f579b98ea22d3ef8ed9232b63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e381659d0534e32066d1b93aa42557a58f058e2a5fe23b3fcd9e872dc52934bb570c32464f02de31e448709b7627e4a3854ff6ff84c54d82eda467acd61565f1
|
7
|
+
data.tar.gz: 25c0f3f3da5e85796e0b95d8242d921f5f76e22abcceb980d222f87cc6ef270ec61022dfd5495b2eef11dfe3dadf41e7da76f4d8ea3b451d663230168f8387f9
|
data/Gemfile.lock
CHANGED
data/lib/api_six_client/base.rb
CHANGED
@@ -31,10 +31,14 @@ module ApiSixClient
|
|
31
31
|
request __method__, path, params, headers
|
32
32
|
end
|
33
33
|
|
34
|
+
def delete(path, params = {}, headers = {})
|
35
|
+
request __method__, path, params, headers
|
36
|
+
end
|
37
|
+
|
34
38
|
private
|
35
39
|
|
36
40
|
def service_path
|
37
|
-
self.class.name.
|
41
|
+
self.class.name.demodulize.underscore
|
38
42
|
end
|
39
43
|
|
40
44
|
def request(method, path, params = {}, headers = {})
|
@@ -42,9 +46,9 @@ module ApiSixClient
|
|
42
46
|
res = JSON.parse(response.body)
|
43
47
|
|
44
48
|
return res.with_indifferent_access if res.is_a?(Hash)
|
45
|
-
return res
|
49
|
+
return res unless res.is_a?(Array)
|
46
50
|
|
47
|
-
res
|
51
|
+
res.map { |r| r.is_a?(Hash) ? r.with_indifferent_access : r }
|
48
52
|
end
|
49
53
|
|
50
54
|
def connection
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ApiSixClient
|
4
|
+
class BaseInt < Base
|
5
|
+
def initialize(endpoint: nil, auth_token: nil)
|
6
|
+
@endpoint = ApiSixClient.config.endpoint_int
|
7
|
+
@auth_token = ApiSixClient.config.auth_token_int
|
8
|
+
|
9
|
+
raise Errors::EndpointIsEmpty unless @endpoint
|
10
|
+
raise Errors::AuthTokenIsEmpty unless @auth_token
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ApiSixClient
|
4
|
+
class BaseV2 < Base
|
5
|
+
def initialize(endpoint: nil, auth_token: nil)
|
6
|
+
@endpoint = ApiSixClient.config.endpoint_v2
|
7
|
+
@auth_token = ApiSixClient.config.auth_token_v2
|
8
|
+
|
9
|
+
raise Errors::EndpointIsEmpty unless @endpoint
|
10
|
+
raise Errors::AuthTokenIsEmpty unless @auth_token
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -3,10 +3,7 @@
|
|
3
3
|
module ApiSixClient
|
4
4
|
class Config
|
5
5
|
attr_accessor :endpoint, :auth_token
|
6
|
-
|
7
|
-
|
8
|
-
@endpoint = endpoint
|
9
|
-
@auth_token = auth_token
|
10
|
-
end
|
6
|
+
attr_accessor :endpoint_v2, :auth_token_v2
|
7
|
+
attr_accessor :endpoint_int, :auth_token_int
|
11
8
|
end
|
12
9
|
end
|
data/lib/api_six_client.rb
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
require 'api_six_client/version'
|
4
4
|
require 'api_six_client/config'
|
5
5
|
require 'api_six_client/base'
|
6
|
+
require 'api_six_client/base_v2'
|
7
|
+
require 'api_six_client/base_int'
|
6
8
|
require 'api_six_client/errors'
|
7
9
|
|
8
10
|
module ApiSixClient
|
@@ -24,4 +26,6 @@ module ApiSixClient
|
|
24
26
|
class Fin < Base; end
|
25
27
|
class Olc < Base; end
|
26
28
|
class Eno < Base; end
|
29
|
+
|
30
|
+
class AuthInt < BaseInt; end
|
27
31
|
end
|
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
|
+
version: 1.2.0
|
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-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -42,6 +42,8 @@ files:
|
|
42
42
|
- bin/setup
|
43
43
|
- lib/api_six_client.rb
|
44
44
|
- lib/api_six_client/base.rb
|
45
|
+
- lib/api_six_client/base_int.rb
|
46
|
+
- lib/api_six_client/base_v2.rb
|
45
47
|
- lib/api_six_client/config.rb
|
46
48
|
- lib/api_six_client/errors.rb
|
47
49
|
- lib/api_six_client/version.rb
|