finapps 0.1.8.pre → 0.1.10.pre

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
  SHA1:
3
- metadata.gz: 30876b25f377f6c13e4ad4e8c343d5c4c31a11af
4
- data.tar.gz: b4bb089beffd2bd95adaacbae50aa08e2d72aa1a
3
+ metadata.gz: f9bb9c1f912e72afc9a3b0b8c72e1f8285df32a7
4
+ data.tar.gz: 7047152f6c890bd120dc1e0cd1ef4ce76f393e09
5
5
  SHA512:
6
- metadata.gz: f743583ba7756bf02c5026cdf381ba1a3260d0e4383972a801365d37174e0c518e36132635e9ede84b78a0ed5f0d89e9aad369a4f1f4c1d0a56624910decc32d
7
- data.tar.gz: fd428d18e09e732e0c03f20002f44f1e8e2ad19f79e47cb674e297f4ca091228ae7c27dfd46f48e3e35f7a3ad7b948559bbb2c13cd5f42f74adeab87d74c2705
6
+ metadata.gz: 1739253c2b1d1c9420ceb99c486ea5d30f64763552d221fc41c015649a7a45c6b219d36159ef4906294044f73258c23e196cf3e2f3e205c2c7ef6c76f271897e
7
+ data.tar.gz: 445c302fe03d7727540fbd58e7bab99d4b6e3a5408adfe2a91ae5233f66d910f38808c59a77f9520aa1ab3ec35ba51b0c81431d6b4073ee10f66f52980c3ec77
@@ -45,6 +45,7 @@ module FinApps
45
45
  # @return [Hash,Array<String>]
46
46
  def send(path, method, params = {}, &proc)
47
47
  logger.debug "##{__method__.to_s} => Started"
48
+ raise MissingArgumentsError.new 'Missing argument: method.' if method.blank?
48
49
  result, error_messages = nil, nil
49
50
 
50
51
  begin
@@ -88,20 +89,15 @@ module FinApps
88
89
  def get(path, &proc)
89
90
  logger.debug "##{__method__.to_s} => Started"
90
91
  raise MissingArgumentsError.new 'Missing argument: path.' if path.blank?
91
- response, result, error_messages = nil, nil, nil
92
+ result, error_messages = nil, nil
92
93
 
93
- begin
94
- logger.debug "##{__method__.to_s} => GET path:#{path}"
95
- response = @connection.get do |req|
96
- req.url path
97
- end
98
- if response.present? && block_given?
99
- result = proc.call(response)
100
- logger.debug "##{__method__.to_s} => parsed result: #{result.pretty_inspect}" if result.present?
101
- end
102
- rescue FinApps::REST::Error => error
103
- error_messages = error.error_messages
104
- logger.debug "##{__method__.to_s} => Failed, error_messages: #{error_messages.pretty_inspect}" if error_messages.present?
94
+ logger.debug "##{__method__.to_s} => GET path:#{path}"
95
+ response = @connection.get do |req|
96
+ req.url path
97
+ end
98
+ if response.present? && block_given?
99
+ result = proc.call(response)
100
+ logger.debug "##{__method__.to_s} => parsed result: #{result.pretty_inspect}" if result.present?
105
101
  end
106
102
 
107
103
  logger.debug "##{__method__.to_s} => Completed"
@@ -119,7 +115,7 @@ module FinApps
119
115
  def post(path, params = {}, &proc)
120
116
  logger.debug "##{__method__.to_s} => Started"
121
117
  raise MissingArgumentsError.new 'Missing argument: path.' if path.blank?
122
- result, error_messages = nil, nil, nil
118
+ result, error_messages = nil, nil
123
119
 
124
120
  logger.debug "##{__method__.to_s} => POST path:#{path} params:#{skip_sensitive_data(params)}"
125
121
  response = @connection.post do |req|
@@ -20,7 +20,7 @@ module FinApps
20
20
  path = end_point.sub ':search_term', ERB::Util.url_encode(term)
21
21
  logger.debug "##{__method__.to_s} => path: #{path}"
22
22
 
23
- institutions, error_messages = @client.get(path) do |r|
23
+ institutions, error_messages = @client.post(path, :post) do |r|
24
24
  r.body.each { |i| Institution.new(i) }
25
25
  end
26
26
 
@@ -41,7 +41,7 @@ module FinApps
41
41
  path = end_point.sub ':site_id', ERB::Util.url_encode(site_id)
42
42
  logger.debug "##{__method__.to_s} => path: #{path}"
43
43
 
44
- institution, error_messages = @client.get(path) { |r| Institution.new(r.body) }
44
+ institution, error_messages = @client.send(path, :get) { |r| Institution.new(r.body) }
45
45
 
46
46
  logger.debug "##{__method__.to_s} => Completed"
47
47
  return institution, error_messages
@@ -15,7 +15,7 @@ module FinApps
15
15
  end_point = Defaults::END_POINTS[:users_create]
16
16
  logger.debug "##{__method__.to_s} => end_point: #{end_point}"
17
17
 
18
- user, error_messages = @client.post(end_point, params) { |r| User.new(r.body) }
18
+ user, error_messages = @client.send(end_point, :post, params) { |r| User.new(r.body) }
19
19
  logger.debug "##{__method__.to_s} => Completed"
20
20
 
21
21
  return user, error_messages
@@ -31,7 +31,7 @@ module FinApps
31
31
  end_point = Defaults::END_POINTS[:users_login]
32
32
  logger.debug "##{__method__.to_s} => end_point: #{end_point}"
33
33
 
34
- user, error_messages = @client.post(end_point, params) { |r| User.new(r.body) }
34
+ user, error_messages = @client.send(end_point, :post, params) { |r| User.new(r.body) }
35
35
  logger.debug "##{__method__.to_s} => Completed"
36
36
 
37
37
  return user, error_messages
@@ -51,7 +51,7 @@ module FinApps
51
51
  path = end_point.sub ':public_id', ERB::Util.url_encode(public_id)
52
52
  logger.debug "##{__method__.to_s} => path: #{path}"
53
53
 
54
- _, error_messages = @client.delete(path)
54
+ _, error_messages = @client.send(path, :delete)
55
55
  logger.debug "##{__method__.to_s} => Completed"
56
56
 
57
57
  error_messages
@@ -1,3 +1,3 @@
1
1
  module FinApps
2
- VERSION = '0.1.8.pre'
2
+ VERSION = '0.1.10.pre'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.pre
4
+ version: 0.1.10.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero