rxg_client 1.1.0 → 1.1.1
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 +4 -4
- data/lib/rxg_client.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1701747767676c3880b62220730a35f0f8f44c7e5a6300219e677f51699498c
|
4
|
+
data.tar.gz: ef34d6aca636d4bde2a0874e7377d87ba8fe088d984fb0d0033d969bdae710e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ede8e416e727eb38cb3f7b330bcb6c78972196bad4034076d74889ccc78f5b3e68bc647baf0865125a128a32a0bc04cacca687aed8a9ad479be642c4e2672198
|
7
|
+
data.tar.gz: cb7242e69c10248b585456fc5cc9c464bd7d6e1abad06e78f9a5beae7ba1056123b6d5904c4ed9ecb73a24a558fd9d9733a4e65b472bb4ad19ddfae9e9b5312e
|
data/lib/rxg_client.rb
CHANGED
@@ -4,7 +4,7 @@ class RxgClient
|
|
4
4
|
include HTTParty
|
5
5
|
|
6
6
|
attr_accessor :api_key, :hostname, :base_uri, :fleet, :request_format,
|
7
|
-
:raise_exceptions, :verify_ssl, :auth_method, :default_timeout, :debug_output
|
7
|
+
:raise_exceptions, :verify_ssl, :auth_method, :default_timeout, :debug_output
|
8
8
|
|
9
9
|
def request_format= (requested_format)
|
10
10
|
raise HTTParty::UnsupportedFormat unless [ :json, :xml ].include?(requested_format.to_sym)
|
@@ -48,7 +48,7 @@ class RxgClient
|
|
48
48
|
|
49
49
|
self.verify_ssl = verify_ssl
|
50
50
|
|
51
|
-
self.debug_output =
|
51
|
+
self.debug_output = debug_output
|
52
52
|
|
53
53
|
self.request_format = request_format.to_sym
|
54
54
|
|
@@ -107,7 +107,7 @@ class RxgClient
|
|
107
107
|
|
108
108
|
%i(post get put patch delete).each do |http_method|
|
109
109
|
define_method(http_method) do |action, **args|
|
110
|
-
|
110
|
+
action = "/#{action.to_s.delete_prefix('/')}"
|
111
111
|
default_args = {
|
112
112
|
:headers => self.default_header.merge(args.delete(:headers) || {}),
|
113
113
|
:query => self.default_query.merge(args.delete(:query) || {}).presence,
|
@@ -116,7 +116,7 @@ class RxgClient
|
|
116
116
|
:format => self.request_format,
|
117
117
|
:debug_output => self.debug_output
|
118
118
|
}
|
119
|
-
response = self.class.send(http_method,
|
119
|
+
response = self.class.send(http_method, action, **default_args.merge(args))
|
120
120
|
response.success? ? self.parse(response.body) : raise(response.message)
|
121
121
|
end
|
122
122
|
end
|