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 +4 -4
- data/lib/zaig/registration.rb +6 -2
- data/lib/zaig/version.rb +1 -1
- data/lib/zaig.rb +1 -14
- metadata +2 -18
- data/lib/config/settings/development.yml +0 -5
- data/lib/config/settings/production.yml +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4babb0d0bda420a84f8f2d76fd18e071d0bed7850894b16a40893093a3342e52
|
|
4
|
+
data.tar.gz: 3621eb17427b7c045ccb7a30a718e349f9480ed9b13a3639164c5d1dcead52ca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c83914f1e233d92f84df4358203895fd12afa8fe6ccc5718a0d30b9749370f0ee0d9a6d7c09b6b25f341594226e718d2156f064482ff90f1608376f2daa434e8
|
|
7
|
+
data.tar.gz: 8ee4b8a9afba32cfbf2484c3fa20ae66f60feea5eae5fac9a62881f22b299a378e4ec452f3370672def9eff4811e95c6388fc6cd8b9d18cc99c55fbf0c4cef48
|
data/lib/zaig/registration.rb
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
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, :
|
|
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.
|
|
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-
|
|
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
|