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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0820315f337d7950f42401807db88f3cddc874878e90d0f0227c40431a7a6e2a'
4
- data.tar.gz: 2d72ad53e2424ef2eab44ccf83420793f192b0818b33a61f1b02fefc38b15014
3
+ metadata.gz: 3a115efbdba0e8c4611b3a1e5893818c300006f5427c0063e862bc8f50178b7a
4
+ data.tar.gz: ce24737f7ea275b5ee71b51f7c96e9714d678cf64535167fdaabca0fa4d519c0
5
5
  SHA512:
6
- metadata.gz: fe2ae6d535260712145674a35a9847ae478cf2e8522183781f4a90819803569c290cc7553d2eded6e2211ae746bbc88cbb2cf782a6326819e093ed4274467fea
7
- data.tar.gz: '058caeb2eedbd896dd55e54622b8982f688f79a3f5600c42c47f85bc96bc93d9c1f427cbe5f4b6cdb33ac9ebf4b9673f3c8365a6dd306ff6e63125dabb7e046b'
6
+ metadata.gz: 17975f36fa01b7d83ae763a510cb97dab38e00c4e70dfea69d643ef83adb50b873cf4028c21be8d55493cc2ea60aafa7cad0ad732596035cc2da9ad688d924df
7
+ data.tar.gz: 5747ebde9e20d2b91f7354cbc5e34b16c9dcd1431fc57e6b8c64f0d693d2d1d0622518f6adef287219a37681d1c952ba2e4f9f7c64a8f044aef23a25f15c2a4b
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Katinguele
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.4'
5
5
  end
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.3
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-19 00:00:00.000000000 Z
11
+ date: 2019-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday