zaig 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30513348586e4a10175c951a36ef1ccadce659a39297cb48126d0d9ff12e7273
4
- data.tar.gz: 92392c3685c0ef19300d596dd366e2be4db979fad0ac90011df0631d4c0762cb
3
+ metadata.gz: 4babb0d0bda420a84f8f2d76fd18e071d0bed7850894b16a40893093a3342e52
4
+ data.tar.gz: 3621eb17427b7c045ccb7a30a718e349f9480ed9b13a3639164c5d1dcead52ca
5
5
  SHA512:
6
- metadata.gz: 202bc4d5ed18dd3bf5fb64c287a7964221ade5f56cfd009b23284011da45143c84e5f8700c37bd0e3126cc4a96c272deb629fd46af8e75ae0fcafd3604ef5de8
7
- data.tar.gz: eca0bb1e343286657059cf407076bd15e1a32a08bf5ff6e693ac713c95fde29fa0501ac0b56f6f29d6f2aafcf1dbd875106379fc26be9d8c0dbd4f9c73d649bd
6
+ metadata.gz: c83914f1e233d92f84df4358203895fd12afa8fe6ccc5718a0d30b9749370f0ee0d9a6d7c09b6b25f341594226e718d2156f064482ff90f1608376f2daa434e8
7
+ data.tar.gz: 8ee4b8a9afba32cfbf2484c3fa20ae66f60feea5eae5fac9a62881f22b299a378e4ec452f3370672def9eff4811e95c6388fc6cd8b9d18cc99c55fbf0c4cef48
@@ -9,15 +9,19 @@ module Zaig
9
9
 
10
10
  include Singleton
11
11
 
12
+ ENDPOINT = "zaig/consulta_de_credito"
13
+
12
14
  def initialize(connection: Zaig::Connection.new, registration_payload: Zaig::RegistrationPayload.instance)
13
15
  @connection = connection
14
16
  @registration_payload = registration_payload
15
17
  end
16
18
 
17
19
  def call(obj)
18
- endpoint = Zaig.configuration.defaults.api.endpoints.inquiry.credit.freeze
19
20
  payload = @registration_payload.call(obj)
20
- res = @connection.post(url: endpoint, body: payload.to_json)
21
+
22
+ req_endpoint = Zaig.configuration.registration_endpoint
23
+
24
+ res = @connection.post(url: (req_endpoint.nil? ? ENDPOINT : req_endpoint), body: payload.to_json)
21
25
 
22
26
  verify_response(res)
23
27
 
data/lib/zaig/version.rb CHANGED
@@ -8,5 +8,5 @@ module Zaig
8
8
  # Major - Incremented for incompatible changes with previous release (or big enough new features)
9
9
  # Minor - Incremented for new backwards-compatible features + deprecations
10
10
  # Patch - Incremented for backwards-compatible bug fixes
11
- VERSION = "1.0.0"
11
+ VERSION = "1.0.1"
12
12
  end
data/lib/zaig.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "confset"
4
3
  require "cpf_cnpj"
5
4
  require "flash_integration"
6
5
  require "i18n"
@@ -48,18 +47,6 @@ module Zaig
48
47
 
49
48
  # Basic configuration settings
50
49
  class Configuration
51
- attr_accessor :access_token, :base_url, :env
52
- attr_reader :defaults
53
-
54
- def initialize
55
- @env = "development"
56
-
57
- load_defaults
58
- end
59
-
60
- def load_defaults
61
- @defaults = Confset.load_files("lib/config/settings/#{@env}.yml")
62
- @base_url = @defaults.api.base_url
63
- end
50
+ attr_accessor :access_token, :base_url, :registration_endpoint
64
51
  end
65
52
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaig
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Carolino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-14 00:00:00.000000000 Z
11
+ date: 2022-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: confset
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 1.0.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: 1.0.0
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: cpf_cnpj
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -295,8 +281,6 @@ extensions: []
295
281
  extra_rdoc_files: []
296
282
  files:
297
283
  - Rakefile
298
- - lib/config/settings/development.yml
299
- - lib/config/settings/production.yml
300
284
  - lib/locales/en.yml
301
285
  - lib/locales/pt-BR.yml
302
286
  - lib/zaig.rb
@@ -1,5 +0,0 @@
1
- api:
2
- base_url: https://integra-o-zaig.dev.qflash.com.br
3
- endpoints:
4
- inquiry:
5
- credit: zaig/consulta_de_credito
@@ -1,5 +0,0 @@
1
- api:
2
- base_url: https://integra-o-zaig.prod.qflash.com.br/
3
- endpoints:
4
- inquiry:
5
- credit: zaig/consulta_de_credito