wealthforge-ruby 2.2.3 → 2.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wealthforge/api_exception.rb +1 -3
- data/lib/wealthforge/connection.rb +17 -12
- data/lib/wealthforge/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcd8122910f6620bbbc235b951d7185c3237c9f1
|
4
|
+
data.tar.gz: 21112526fe39abcd43a61fe5fa66a0246995cff8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d57a41dd0c40ae3273dd6e215e500b7f128a9bd320bf06e163a6608af7915ec2081621c30e6f3f3d394539e2f92f141c4c553f050e623655a712c2df05180094
|
7
|
+
data.tar.gz: e90c12a26e768203a99f46604a05fa498fb029c888aab048af7f334414870058166a0754aae1898976b9246e174c168bf2036e33ae47522faf2b2103ae5cb25e
|
@@ -5,7 +5,6 @@ require 'csv'
|
|
5
5
|
require 'timeout'
|
6
6
|
require 'resolv-replace'
|
7
7
|
require 'jwt'
|
8
|
-
require 'pp'
|
9
8
|
|
10
9
|
class WealthForge::Connection
|
11
10
|
|
@@ -19,9 +18,7 @@ class WealthForge::Connection
|
|
19
18
|
rescue => e
|
20
19
|
raise WealthForge::ApiException.new(e)
|
21
20
|
end
|
22
|
-
|
23
|
-
check_result(result)
|
24
|
-
result
|
21
|
+
JSON.parse(response.body)
|
25
22
|
end
|
26
23
|
|
27
24
|
|
@@ -39,6 +36,20 @@ class WealthForge::Connection
|
|
39
36
|
end
|
40
37
|
|
41
38
|
|
39
|
+
def self.patch(endpoint, params)
|
40
|
+
begin
|
41
|
+
response = connection.patch do |req|
|
42
|
+
req.url endpoint
|
43
|
+
req.headers['Content-Type'] = 'application/json'
|
44
|
+
req.body = params.to_json
|
45
|
+
end
|
46
|
+
rescue => e
|
47
|
+
raise WealthForge::ApiException.new(e)
|
48
|
+
end
|
49
|
+
response.body
|
50
|
+
end
|
51
|
+
|
52
|
+
|
42
53
|
def self.file_upload (endpoint, file, filename, mime_type)
|
43
54
|
payload = {:file => Faraday::UploadIO.new(file, mime_type, filename)}
|
44
55
|
begin
|
@@ -57,6 +68,8 @@ class WealthForge::Connection
|
|
57
68
|
set_token
|
58
69
|
return Faraday.new(:url => @api_url) do |faraday|
|
59
70
|
faraday.request :url_encoded
|
71
|
+
faraday.options.timeout = 5
|
72
|
+
faraday.options.open_timeout = 5
|
60
73
|
faraday.headers['Authorization'] = @wf_token
|
61
74
|
faraday.adapter Faraday.default_adapter
|
62
75
|
faraday.use CustomErrors
|
@@ -64,14 +77,6 @@ class WealthForge::Connection
|
|
64
77
|
end
|
65
78
|
|
66
79
|
|
67
|
-
def self.check_result(result)
|
68
|
-
pp result
|
69
|
-
unless result['errors'].nil?
|
70
|
-
pp result
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
|
75
80
|
def self.connection_multipart
|
76
81
|
set_token
|
77
82
|
return Faraday.new(:url => @api_url) do |faraday|
|
data/lib/wealthforge/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wealthforge-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dino Simone | dinosimone.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|