creditario-client 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/Gemfile.lock +1 -1
- data/lib/creditario/api/create.rb +1 -1
- data/lib/creditario/api/multipart.rb +1 -1
- data/lib/creditario/api/request.rb +6 -3
- data/lib/creditario/api/update.rb +1 -1
- data/lib/creditario/client/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: b450f825957ef5b550f453f2ab1cdcfd8abf1813cf5ad7c063d5922011498168
|
4
|
+
data.tar.gz: 5513a8630e36dc9b0499b14ddd286999eaec7dcfd551d86a7aa438d41c837418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d178b5ba0750bace58ac00928c020135e85fc832880e981e2a05f6e5e5b2009cae74c6144eda615024f2878de1cd7bff7c70cfb1ee2f04dbea0e09615035dd1d
|
7
|
+
data.tar.gz: e094ded2b9b11c5fc7bc079df4f851d4d8c10a1f1daef481391254b3c487eb673da2cc13dcd9ff4d733e5c2ec0c917322cd9580f8064c84d1362cedb8d6eabb9
|
data/CHANGELOG
CHANGED
data/Gemfile.lock
CHANGED
@@ -22,7 +22,7 @@ module Creditario # :nodoc:
|
|
22
22
|
#
|
23
23
|
def create(params = {})
|
24
24
|
enctype = params.delete(:enctype) || false
|
25
|
-
request_method = enctype ? :
|
25
|
+
request_method = enctype ? :multipart_post : :post
|
26
26
|
response = API.request(request_method, self.resource_path, params)
|
27
27
|
|
28
28
|
attributes = response.dig("data").first
|
@@ -15,7 +15,7 @@ module Creditario # :nodoc:
|
|
15
15
|
# Repositorio maneja.
|
16
16
|
# De lo contrario, regresa un Hash con los errores arrojados por el servidor de creditar.io
|
17
17
|
def create(params = {})
|
18
|
-
response = API.request(:
|
18
|
+
response = API.request(:multipart_post, self.resource_path, params)
|
19
19
|
|
20
20
|
attributes = response.dig("data").first
|
21
21
|
links = response.dig("links")
|
@@ -32,6 +32,9 @@ module Creditario # :nodoc:
|
|
32
32
|
uri = URI(Creditario::Client.api_base + path)
|
33
33
|
request = request_from_method(method, uri, params)
|
34
34
|
|
35
|
+
request["User-Agent"] = "creditario-client gem v#{Creditario::Client::VERSION}"
|
36
|
+
request["Accept"] = "application/vnd.creditar.v#{Creditario::Client.api_version}+json"
|
37
|
+
|
35
38
|
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |http|
|
36
39
|
http.request(request)
|
37
40
|
end
|
@@ -63,8 +66,10 @@ module Creditario # :nodoc:
|
|
63
66
|
request
|
64
67
|
when :post
|
65
68
|
set_request_body(set_request_headers(Net::HTTP::Post.new(uri)), params)
|
66
|
-
when :
|
69
|
+
when :multipart_post
|
67
70
|
set_authorization_headers(Net::HTTP::Post::Multipart.new(uri, params))
|
71
|
+
when :multipart_patch
|
72
|
+
set_authorization_headers(Net::HTTP::Put::Multipart.new(uri, params))
|
68
73
|
when :delete
|
69
74
|
set_request_headers(Net::HTTP::Delete.new(uri))
|
70
75
|
when :patch
|
@@ -75,8 +80,6 @@ module Creditario # :nodoc:
|
|
75
80
|
def set_request_headers(request)
|
76
81
|
request = set_authorization_headers(request)
|
77
82
|
|
78
|
-
request["User-Agent"] = "creditario-client gem v#{Creditario::Client::VERSION}"
|
79
|
-
request["Accept"] = "application/vnd.creditar.v#{Creditario::Client.api_version}+json"
|
80
83
|
request["Content-Type"] = "application/json"
|
81
84
|
|
82
85
|
request
|
@@ -23,7 +23,7 @@ module Creditario # :nodoc:
|
|
23
23
|
enctype = params.delete(:enctype) || false
|
24
24
|
path = "#{self.resource_path}/#{id}"
|
25
25
|
path = include_param.nil? ? path : path + "?include=#{include_param}"
|
26
|
-
request_method = enctype ? :
|
26
|
+
request_method = enctype ? :multipart_patch : :patch
|
27
27
|
response = API.request(request_method, path, params)
|
28
28
|
|
29
29
|
attributes = response.dig("data").first
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: creditario-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- michelada.io
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|