katinguele 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/katinguele/request.rb +16 -8
- data/lib/katinguele/version.rb +1 -1
- 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: 3a115efbdba0e8c4611b3a1e5893818c300006f5427c0063e862bc8f50178b7a
|
4
|
+
data.tar.gz: ce24737f7ea275b5ee71b51f7c96e9714d678cf64535167fdaabca0fa4d519c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17975f36fa01b7d83ae763a510cb97dab38e00c4e70dfea69d643ef83adb50b873cf4028c21be8d55493cc2ea60aafa7cad0ad732596035cc2da9ad688d924df
|
7
|
+
data.tar.gz: 5747ebde9e20d2b91f7354cbc5e34b16c9dcd1431fc57e6b8c64f0d693d2d1d0622518f6adef287219a37681d1c952ba2e4f9f7c64a8f044aef23a25f15c2a4b
|
data/lib/katinguele/request.rb
CHANGED
@@ -17,6 +17,14 @@ module Katinguele
|
|
17
17
|
url
|
18
18
|
].freeze
|
19
19
|
|
20
|
+
DEFAULT = {
|
21
|
+
headers: {},
|
22
|
+
logger: false,
|
23
|
+
params: {},
|
24
|
+
payload: {},
|
25
|
+
raise_error: false
|
26
|
+
}.freeze
|
27
|
+
|
20
28
|
attr_accessor(*(ACCESSORS | %i[uri method]))
|
21
29
|
|
22
30
|
def initialize(options = {})
|
@@ -31,14 +39,6 @@ module Katinguele
|
|
31
39
|
ACCESSORS.each_with_object({}) { |accessor, obj| obj[accessor] = send(accessor) }
|
32
40
|
end
|
33
41
|
|
34
|
-
def setup!(options = {})
|
35
|
-
accessors!(options || {})
|
36
|
-
validate!
|
37
|
-
build_urn!
|
38
|
-
handle_query_params!
|
39
|
-
handle_urn_params!
|
40
|
-
end
|
41
|
-
|
42
42
|
def before!(*params)
|
43
43
|
hook!(:before, params)
|
44
44
|
end
|
@@ -49,6 +49,14 @@ module Katinguele
|
|
49
49
|
|
50
50
|
private
|
51
51
|
|
52
|
+
def setup!(options = {})
|
53
|
+
accessors!(DEFAULT.merge(options || {}))
|
54
|
+
validate!
|
55
|
+
build_urn!
|
56
|
+
handle_query_params!
|
57
|
+
handle_urn_params!
|
58
|
+
end
|
59
|
+
|
52
60
|
def hook!(hook, params)
|
53
61
|
return unless send(hook)&.is_a?(Proc)
|
54
62
|
|
data/lib/katinguele/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: katinguele
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- linqueta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|