finapps 0.1.7.pre → 0.1.8.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/finapps/rest/client.rb +9 -22
- data/lib/finapps/rest/user_institutions.rb +1 -1
- data/lib/finapps/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30876b25f377f6c13e4ad4e8c343d5c4c31a11af
|
4
|
+
data.tar.gz: b4bb089beffd2bd95adaacbae50aa08e2d72aa1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f743583ba7756bf02c5026cdf381ba1a3260d0e4383972a801365d37174e0c518e36132635e9ede84b78a0ed5f0d89e9aad369a4f1f4c1d0a56624910decc32d
|
7
|
+
data.tar.gz: fd428d18e09e732e0c03f20002f44f1e8e2ad19f79e47cb674e297f4ca091228ae7c27dfd46f48e3e35f7a3ad7b948559bbb2c13cd5f42f74adeab87d74c2705
|
data/lib/finapps/rest/client.rb
CHANGED
@@ -119,29 +119,16 @@ module FinApps
|
|
119
119
|
def post(path, params = {}, &proc)
|
120
120
|
logger.debug "##{__method__.to_s} => Started"
|
121
121
|
raise MissingArgumentsError.new 'Missing argument: path.' if path.blank?
|
122
|
-
|
122
|
+
result, error_messages = nil, nil, nil
|
123
123
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
logger.debug "##{__method__.to_s} => parsed result: #{result.pretty_inspect}" if result.present?
|
133
|
-
end
|
134
|
-
|
135
|
-
rescue FinApps::REST::Error => error
|
136
|
-
error_messages = error.error_messages
|
137
|
-
rescue Faraday::ParsingError => error
|
138
|
-
error_messages = ['Unable to parse the server response.']
|
139
|
-
logger.debug "##{__method__.to_s} => Faraday::ParsingError, #{error.to_s}"
|
140
|
-
rescue Exception => error
|
141
|
-
error_messages = ['Unexpected error.']
|
142
|
-
logger.debug "##{__method__.to_s} => Exception, #{error.to_s}"
|
143
|
-
ensure
|
144
|
-
logger.debug "##{__method__.to_s} => Failed, error_messages: #{error_messages.pretty_inspect}" if error_messages.present?
|
124
|
+
logger.debug "##{__method__.to_s} => POST path:#{path} params:#{skip_sensitive_data(params)}"
|
125
|
+
response = @connection.post do |req|
|
126
|
+
req.url path
|
127
|
+
req.body = params
|
128
|
+
end
|
129
|
+
if response.present? && block_given?
|
130
|
+
result = proc.call(response)
|
131
|
+
logger.debug "##{__method__.to_s} => parsed result: #{result.pretty_inspect}" if result.present?
|
145
132
|
end
|
146
133
|
|
147
134
|
logger.debug "##{__method__.to_s} => Completed"
|
@@ -21,7 +21,7 @@ module FinApps
|
|
21
21
|
path = end_point.sub ':site_id', ERB::Util.url_encode(site_id)
|
22
22
|
logger.debug "##{__method__.to_s} => path: #{path}"
|
23
23
|
|
24
|
-
user_institution, error_messages = @client.
|
24
|
+
user_institution, error_messages = @client.send(path, :post, :parameters => parameters ) do |r|
|
25
25
|
UserInstitution.new(r.body)
|
26
26
|
end
|
27
27
|
|
data/lib/finapps/version.rb
CHANGED