finapps 1.0.3 → 1.0.4

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: 1b747f71ddb18cd525077bbb01db22eb846e0e12
4
- data.tar.gz: 1a8fbe7e0d3b9d37fdbc55443e239db2303306db
3
+ metadata.gz: 3985c324f7f63672244fa139b5ab8c792021badf
4
+ data.tar.gz: c9c613457ba255f6bafbfdb2d3481b4f7570717a
5
5
  SHA512:
6
- metadata.gz: bb218d57823afe544d4cc36ada1276ca3857a86c34fa42f5cf047980a606c859888f419c21d7590a9902f4b31646f7db932e1763b3f118a3c5b5a4c9cbb6ef25
7
- data.tar.gz: 20914eaf113fe0905878ac655c7edd39df188b271533c62f250040e2ea4e44cbe49b1327ff723f940473fd20187bd7f29c795c9b09aefa26f4d984178b6ceb3a
6
+ metadata.gz: f57568f879da5059b2f153356da3a8564c07b09876ce0db2d102017d98fea6a9e3d8c773dbcfc2a34ee79eb25789806b4b0d20a3394418d93f65198696013650
7
+ data.tar.gz: 85cae203cff3418ddd3be3b6870ac193281f536d98d79c279aa55ea816160953348e0b13b8b7a47b8e53ee05757d32af3a8e23eac5a22ac80c2b195fd227ef42
@@ -19,8 +19,7 @@ module FinApps
19
19
  path = path.sub ':read', ERB::Util.url_encode(read)
20
20
  logger.debug "##{__method__.to_s} => path: #{path}"
21
21
 
22
- result, error_messages = @client.send_request(path, :get)
23
-
22
+ result, error_messages = client.send_request(path, :get)
24
23
  return result, error_messages
25
24
  end
26
25
 
@@ -39,8 +38,7 @@ module FinApps
39
38
  path = path.sub ':read', ERB::Util.url_encode(read)
40
39
  logger.debug "##{__method__.to_s} => path: #{path}"
41
40
 
42
- _, error_messages = @client.send_request(path, :put)
43
-
41
+ _, error_messages = client.send_request(path, :put)
44
42
  error_messages
45
43
  end
46
44
 
@@ -55,8 +53,7 @@ module FinApps
55
53
  path = end_point.sub ':alert_id', ERB::Util.url_encode(alert_id)
56
54
  logger.debug "##{__method__.to_s} => path: #{path}"
57
55
 
58
- _, error_messages = @client.send_request(path, :delete)
59
-
56
+ _, error_messages = client.send_request(path, :delete)
60
57
  error_messages
61
58
  end
62
59
 
@@ -6,6 +6,7 @@ module FinApps
6
6
  class AlertDefinition < FinApps::REST::Resources
7
7
  include FinApps::REST::Defaults
8
8
 
9
+ # Returns a list of alert definitions for current tenant.
9
10
  # @return [Hash, Array<String>]
10
11
  def list
11
12
  end_point = Defaults::END_POINTS[:alert_definition_list]
@@ -14,16 +15,11 @@ module FinApps
14
15
  path = end_point
15
16
  logger.debug "##{__method__.to_s} => path: #{path}"
16
17
 
17
- <<<<<<< HEAD
18
- result, error_messages = @client.send(path, :get)
19
- =======
20
- result, error_messages = @client.send_request(path, :get)
21
-
22
- logger.debug "##{__method__.to_s} => Completed"
23
- >>>>>>> develop
18
+ result, error_messages = client.send_request(path, :get)
24
19
  return result, error_messages
25
20
  end
26
21
 
22
+ # Shows a single alert definition matching the given alert name.
27
23
  # @return [Hash, Array<String>]
28
24
  def show(alert_name)
29
25
  raise MissingArgumentsError.new 'Missing argument: alert_name.' if alert_name.blank?
@@ -35,16 +31,10 @@ module FinApps
35
31
  path = end_point.sub ':alert_name', ERB::Util.url_encode(alert_name)
36
32
  logger.debug "##{__method__.to_s} => path: #{path}"
37
33
 
38
- <<<<<<< HEAD
39
- result, error_messages = @client.send(path, :get)
40
- =======
41
- result, error_messages = @client.send_request(path, :get)
42
-
43
- logger.debug "##{__method__.to_s} => Completed"
44
- >>>>>>> develop
34
+ result, error_messages = client.send_request(path, :get)
45
35
  return result, error_messages
46
36
  end
47
37
 
48
38
  end
49
39
  end
50
- end
40
+ end
@@ -6,6 +6,7 @@ module FinApps
6
6
  class AlertPreferences < FinApps::REST::Resources
7
7
  include FinApps::REST::Defaults
8
8
 
9
+ # Shows alert preferences for a given user
9
10
  # @return [Hash, Array<String>]
10
11
  def show
11
12
  end_point = Defaults::END_POINTS[:alert_preferences_show]
@@ -14,16 +15,11 @@ module FinApps
14
15
  path = end_point
15
16
  logger.debug "##{__method__.to_s} => path: #{path}"
16
17
 
17
- <<<<<<< HEAD
18
- result, error_messages = @client.send(path, :get)
19
- =======
20
- result, error_messages = @client.send_request(path, :get)
21
-
22
- logger.debug "##{__method__.to_s} => Completed"
23
- >>>>>>> develop
18
+ result, error_messages = client.send_request(path, :get)
24
19
  return result, error_messages
25
20
  end
26
21
 
22
+ # Updates alert preferences for a given user
27
23
  # @return [Hash, Array<String>]
28
24
  def update(params)
29
25
  raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
@@ -35,16 +31,10 @@ module FinApps
35
31
  path = end_point
36
32
  logger.debug "##{__method__.to_s} => path: #{path}"
37
33
 
38
- <<<<<<< HEAD
39
- _, error_messages = @client.send(path, :put, params.compact)
40
- =======
41
- _, error_messages = @client.send_request(path, :put, params.compact)
42
-
43
- logger.debug "##{__method__.to_s} => Completed"
44
- >>>>>>> develop
34
+ _, error_messages = client.send_request(path, :put, params.compact)
45
35
  error_messages
46
36
  end
47
37
 
48
38
  end
49
39
  end
50
- end
40
+ end
@@ -6,6 +6,7 @@ module FinApps
6
6
  class AlertSettings < FinApps::REST::Resources
7
7
  include FinApps::REST::Defaults
8
8
 
9
+ # Shows alert settings for a given user.
9
10
  # @return [Hash, Array<String>]
10
11
  def show
11
12
  end_point = Defaults::END_POINTS[:alert_settings_show]
@@ -14,16 +15,11 @@ module FinApps
14
15
  path = end_point
15
16
  logger.debug "##{__method__.to_s} => path: #{path}"
16
17
 
17
- <<<<<<< HEAD
18
- result, error_messages = @client.send(path, :get)
19
- =======
20
- result, error_messages = @client.send_request(path, :get)
21
-
22
- logger.debug "##{__method__.to_s} => Completed"
23
- >>>>>>> develop
18
+ result, error_messages = client.send_request(path, :get)
24
19
  return result, error_messages
25
20
  end
26
21
 
22
+ # Updates alert settings for a given user.
27
23
  # @return [Hash, Array<String>]
28
24
  def update(params)
29
25
  raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
@@ -35,16 +31,10 @@ module FinApps
35
31
  path = end_point
36
32
  logger.debug "##{__method__.to_s} => path: #{path}"
37
33
 
38
- <<<<<<< HEAD
39
- _, error_messages = @client.send(path, :put, params.compact)
40
- =======
41
- _, error_messages = @client.send_request(path, :put, params.compact)
42
-
43
- logger.debug "##{__method__.to_s} => Completed"
44
- >>>>>>> develop
34
+ _, error_messages = client.send_request(path, :put, params.compact)
45
35
  error_messages
46
36
  end
47
37
 
48
38
  end
49
39
  end
50
- end
40
+ end
@@ -6,13 +6,14 @@ module FinApps
6
6
  class BudgetCalculation < FinApps::REST::Resources
7
7
  include FinApps::REST::Defaults
8
8
 
9
+ # Creates a new Budget Calculation for the given user, using a budget template
10
+ # matching budget_model_id and teh given income amount.
9
11
  # @param [String] budget_model_id
10
12
  # @param [Number] income
11
13
  # @return [Array<Hash>, Array<String>]
12
14
  def create(budget_model_id, income)
13
15
  raise MissingArgumentsError.new 'Missing argument: budget_model_id.' if budget_model_id.blank?
14
16
  logger.debug "##{__method__.to_s} => budget_model: #{budget_model_id}"
15
-
16
17
  raise MissingArgumentsError.new 'Missing argument: income.' if income.blank?
17
18
  logger.debug "##{__method__.to_s} => income: #{income}"
18
19
 
@@ -22,16 +23,11 @@ module FinApps
22
23
  path = end_point.sub(':budget_model_id', ERB::Util.url_encode(budget_model_id)).sub(':income', ERB::Util.url_encode(income))
23
24
  logger.debug "##{__method__.to_s} => path: #{path}"
24
25
 
25
- <<<<<<< HEAD
26
- budget_calculation, error_messages = @client.send(path, :get)
27
- =======
28
- budget_calculation, error_messages = @client.send_request(path, :get)
29
- logger.debug "##{__method__.to_s} => Completed"
30
-
31
- >>>>>>> develop
26
+ budget_calculation, error_messages = client.send_request(path, :get)
32
27
  return budget_calculation, error_messages
33
28
  end
34
29
 
30
+ # Shows the Budget Calculation for the given user.
35
31
  # @return [Array<Hash>, Array<String>]
36
32
  def show
37
33
  end_point = Defaults::END_POINTS[:budget_calculation_show]
@@ -40,16 +36,10 @@ module FinApps
40
36
  path = end_point
41
37
  logger.debug "##{__method__.to_s} => path: #{path}"
42
38
 
43
- <<<<<<< HEAD
44
- budget_calculation, error_messages = @client.send(path, :get)
45
- =======
46
- budget_calculation, error_messages = @client.send_request(path, :get)
47
- logger.debug "##{__method__.to_s} => Completed"
48
-
49
- >>>>>>> develop
39
+ budget_calculation, error_messages = client.send_request(path, :get)
50
40
  return budget_calculation, error_messages
51
41
  end
52
42
 
53
43
  end
54
44
  end
55
- end
45
+ end
@@ -6,21 +6,17 @@ module FinApps
6
6
  class BudgetModels < FinApps::REST::Resources
7
7
  include FinApps::REST::Defaults
8
8
 
9
+ # Lists all budget models.
9
10
  # @return [Array<Hash>, Array<String>]
10
11
  def list
11
12
  path = Defaults::END_POINTS[:budget_models_list]
12
13
  logger.debug "##{__method__.to_s} => path: #{path}"
13
14
 
14
- <<<<<<< HEAD
15
- budget_models, error_messages = @client.send(path, :get)
16
- =======
17
- budget_models, error_messages = @client.send_request(path, :get)
18
-
19
- logger.debug "##{__method__.to_s} => Completed"
20
- >>>>>>> develop
15
+ budget_models, error_messages = client.send_request(path, :get)
21
16
  return budget_models, error_messages
22
17
  end
23
18
 
19
+ # Shows a budget model matching a given budget_model_id
24
20
  # @param [Integer] budget_model_id
25
21
  def show(budget_model_id)
26
22
  raise MissingArgumentsError.new 'Missing argument: budget_model_id.' if budget_model_id.blank?
@@ -32,13 +28,7 @@ module FinApps
32
28
  path = end_point.sub ':budget_model_id', ERB::Util.url_encode(budget_model_id)
33
29
  logger.debug "##{__method__.to_s} => path: #{path}"
34
30
 
35
- <<<<<<< HEAD
36
- budget_model, error_messages = @client.send(path, :get) { |r| BudgetModel.new(r.body) }
37
- =======
38
- budget_model, error_messages = @client.send_request(path, :get) { |r| BudgetModel.new(r.body) }
39
-
40
- logger.debug "##{__method__.to_s} => Completed"
41
- >>>>>>> develop
31
+ budget_model, error_messages = client.send_request(path, :get) { |r| BudgetModel.new(r.body) }
42
32
  return budget_model, error_messages
43
33
  end
44
34
 
@@ -49,4 +39,4 @@ module FinApps
49
39
  end
50
40
 
51
41
  end
52
- end
42
+ end
@@ -6,13 +6,13 @@ module FinApps
6
6
  class Budgets < FinApps::REST::Resources
7
7
  include FinApps::REST::Defaults
8
8
 
9
+ # Shows budget results for a given date range.
9
10
  # @param [Date] start_date
10
11
  # @param [Date] end_date
11
12
  # @return [Hash, Array<String>]
12
13
  def show(start_date, end_date)
13
14
  raise MissingArgumentsError.new 'Missing argument: start_date.' if start_date.blank?
14
15
  logger.debug "##{__method__.to_s} => start_date: #{start_date}"
15
-
16
16
  raise MissingArgumentsError.new 'Missing argument: end_date.' if end_date.blank?
17
17
  logger.debug "##{__method__.to_s} => end_date: #{end_date}"
18
18
 
@@ -24,7 +24,7 @@ module FinApps
24
24
  path = end_point.sub(':start_date', ERB::Util.url_encode(start_date)).sub(':end_date', ERB::Util.url_encode(end_date))
25
25
  logger.debug "##{__method__.to_s} => path: #{path}"
26
26
 
27
- result, error_messages = @client.send_request(path, :get)
27
+ result, error_messages = client.send_request(path, :get)
28
28
  if result.present? && error_messages.blank?
29
29
  categories = result_categories(result)
30
30
  raise 'Category results-set for budget is not an array.' unless categories.respond_to?(:each)
@@ -36,6 +36,7 @@ module FinApps
36
36
  return budget, error_messages
37
37
  end
38
38
 
39
+ # Updates the budget parameters.
39
40
  # @param [Hash] params
40
41
  # @return [Array<Hash>, Array<String>]
41
42
  def update(params={})
@@ -44,13 +45,7 @@ module FinApps
44
45
  end_point = Defaults::END_POINTS[:budget_update]
45
46
  logger.debug "##{__method__.to_s} => end_point: #{end_point}"
46
47
 
47
- <<<<<<< HEAD
48
- budget, error_messages = @client.send(end_point, :put, params)
49
- =======
50
- budget, error_messages = @client.send_request(end_point, :put, params)
51
- logger.debug "##{__method__.to_s} => Completed"
52
-
53
- >>>>>>> develop
48
+ budget, error_messages = client.send_request(end_point, :put, params)
54
49
  return budget, error_messages
55
50
  end
56
51
 
@@ -105,4 +100,4 @@ module FinApps
105
100
  end
106
101
 
107
102
  end
108
- end
103
+ end
@@ -12,7 +12,6 @@ module FinApps
12
12
  def show(start_date, end_date)
13
13
  raise MissingArgumentsError.new 'Missing argument: start_date.' if start_date.blank?
14
14
  logger.debug "##{__method__.to_s} => start_date: #{start_date}"
15
-
16
15
  raise MissingArgumentsError.new 'Missing argument: end_date.' if end_date.blank?
17
16
  logger.debug "##{__method__.to_s} => end_date: #{end_date}"
18
17
 
@@ -29,7 +28,7 @@ module FinApps
29
28
  path = end_point.sub(':start_date', ERB::Util.url_encode(start_date)).sub(':end_date', ERB::Util.url_encode(end_date))
30
29
  logger.debug "##{__method__.to_s} => path: #{path}"
31
30
 
32
- result, error_messages = @client.send_request(path, :get)
31
+ result, error_messages = client.send_request(path, :get)
33
32
  if result.present? && error_messages.blank?
34
33
 
35
34
  summary = extract_value(result, 'summary')
@@ -85,4 +84,4 @@ module FinApps
85
84
  end
86
85
 
87
86
  end
88
- end
87
+ end
@@ -3,6 +3,7 @@ module FinApps
3
3
  class Categories < FinApps::REST::Resources
4
4
  include FinApps::REST::Defaults
5
5
 
6
+ # Lists all categories.
6
7
  # @return [Array<Hash>, Array<String>]
7
8
  def list
8
9
  end_point = Defaults::END_POINTS[:categories_list]
@@ -11,16 +12,10 @@ module FinApps
11
12
  path = end_point
12
13
  logger.debug "##{__method__.to_s} => path: #{path}"
13
14
 
14
- <<<<<<< HEAD
15
- categories, error_messages = @client.send(path, :get)
16
- =======
17
- categories, error_messages = @client.send_request(path, :get)
18
-
19
- logger.debug "##{__method__.to_s} => Completed"
20
- >>>>>>> develop
15
+ categories, error_messages = client.send_request(path, :get)
21
16
  return categories, error_messages
22
17
  end
23
18
 
24
19
  end
25
20
  end
26
- end
21
+ end
@@ -5,26 +5,22 @@ module FinApps
5
5
  include FinApps::Logging
6
6
  include FinApps::REST::Connection
7
7
 
8
+ attr_reader :config, :company_credentials
9
+
8
10
  # @param [String] company_identifier
9
11
  # @param [String] company_token
10
12
  # @param [Hash] options
11
13
  # @return [FinApps::REST::Client]
12
14
  def initialize(company_identifier, company_token, options = {})
13
15
  @config = DEFAULTS.merge! options
14
- logger_config @config
16
+ logger_config config
15
17
 
16
18
  @company_credentials = {:company_identifier => company_identifier, :company_token => company_token}
17
19
  @company_credentials.validate_required_strings!
18
-
19
- logger.debug "##{__method__.to_s} => Completed"
20
20
  end
21
21
 
22
- <<<<<<< HEAD
23
- set_up_resources
24
- logger.debug "##{__method__.to_s} => All resources initialized"
25
- =======
26
22
  def connection
27
- @connection ||= set_up_connection(@company_credentials, @config)
23
+ @connection ||= set_up_connection(self.company_credentials, @config)
28
24
  end
29
25
 
30
26
  def users
@@ -81,7 +77,6 @@ module FinApps
81
77
 
82
78
  def rule_sets
83
79
  @rule_sets ||= FinApps::REST::Relevance::Rulesets.new self
84
- >>>>>>> develop
85
80
  end
86
81
 
87
82
  # Performs HTTP GET, POST, UPDATE and DELETE requests.
@@ -92,15 +87,7 @@ module FinApps
92
87
  # @param [String] method
93
88
  # @param [Proc] proc
94
89
  # @return [Hash,Array<String>]
95
- <<<<<<< HEAD
96
- def send(path, method, params = {}, &proc)
97
- raise MissingArgumentsError.new 'Missing argument: method.' if method.blank?
98
- result, error_messages = nil, nil
99
- =======
100
90
  def send_request(path, method, params = {}, &proc)
101
- logger.debug "##{__method__.to_s} => Started"
102
- >>>>>>> develop
103
-
104
91
  raise FinApps::REST::MissingArgumentsError.new 'Missing argument: path.' if path.blank?
105
92
  raise FinApps::REST::MissingArgumentsError.new 'Missing argument: method.' if method.blank?
106
93
 
@@ -140,6 +127,7 @@ module FinApps
140
127
  ensure
141
128
  logger.debug "##{__method__.to_s} => Failed, error_messages: #{error_messages.pretty_inspect}" if error_messages.present?
142
129
  end
130
+
143
131
  return result, error_messages
144
132
  end
145
133
 
@@ -147,11 +135,12 @@ module FinApps
147
135
  # @param [String] user_token
148
136
  def user_credentials!(user_identifier, user_token)
149
137
  {:user_identifier => user_identifier, :user_token => user_token}.validate_required_strings!
150
- logger.debug "##{__method__.to_s} => Credentials passed validation. Attempting to set user credentials on current connection."
151
138
 
152
139
  @config[:user_identifier] = user_identifier
153
140
  @config[:user_token] = user_token
154
- @connection = set_up_connection(@company_credentials, @config)
141
+
142
+ logger.debug "##{__method__.to_s} => Attempting to set user credentials on current connection."
143
+ @connection = set_up_connection(company_credentials, config)
155
144
  end
156
145
 
157
146
  private
@@ -166,16 +155,7 @@ module FinApps
166
155
  raise MissingArgumentsError.new 'Missing argument: path.' if path.blank?
167
156
 
168
157
  logger.debug "##{__method__.to_s} => GET path:#{path}"
169
- <<<<<<< HEAD
170
- @connection.get { |req| req.url path }
171
- =======
172
- response = connection.get do |req|
173
- req.url path
174
- end
175
-
176
- logger.debug "##{__method__.to_s} => Completed"
177
- response
178
- >>>>>>> develop
158
+ connection.get { |req| req.url path }
179
159
  end
180
160
 
181
161
  # Performs an HTTP POST request.
@@ -189,11 +169,7 @@ module FinApps
189
169
  raise MissingArgumentsError.new 'Missing argument: path.' if path.blank?
190
170
 
191
171
  logger.debug "##{__method__.to_s} => POST path:#{path} params:#{skip_sensitive_data params }"
192
- <<<<<<< HEAD
193
- @connection.post do |req|
194
- =======
195
- response = connection.post do |req|
196
- >>>>>>> develop
172
+ connection.post do |req|
197
173
  req.url path
198
174
  req.body = params
199
175
  end
@@ -210,11 +186,7 @@ module FinApps
210
186
  raise MissingArgumentsError.new 'Missing argument: path.' if path.blank?
211
187
 
212
188
  logger.debug "##{__method__.to_s} => PUT path:#{path} params:#{skip_sensitive_data(params)}"
213
- <<<<<<< HEAD
214
- @connection.put do |req|
215
- =======
216
- response = connection.put do |req|
217
- >>>>>>> develop
189
+ connection.put do |req|
218
190
  req.url path
219
191
  req.body = params
220
192
  end
@@ -231,38 +203,12 @@ module FinApps
231
203
  raise MissingArgumentsError.new 'Missing argument: path.' if path.blank?
232
204
 
233
205
  logger.debug "##{__method__.to_s} => DELETE path:#{path} params:#{skip_sensitive_data(params)}"
234
- <<<<<<< HEAD
235
- @connection.delete do |req|
236
- =======
237
- response = connection.delete do |req|
238
- >>>>>>> develop
206
+ connection.delete do |req|
239
207
  req.url path
240
208
  req.body = params
241
209
  end
242
210
  end
243
211
 
244
- <<<<<<< HEAD
245
- # Initialize resources.
246
- #
247
- def set_up_resources
248
- @users ||= FinApps::REST::Users.new self
249
- @institutions ||= FinApps::REST::Institutions.new self
250
- @user_institutions ||= FinApps::REST::UserInstitutions.new self
251
- @transactions ||= FinApps::REST::Transactions.new self
252
- @categories ||= FinApps::REST::Categories.new self
253
- @budget_models ||= FinApps::REST::BudgetModels.new self
254
- @budget_calculation ||= FinApps::REST::BudgetCalculation.new self
255
- @budgets ||= FinApps::REST::Budgets.new self
256
- @cashflows ||= FinApps::REST::Cashflows.new self
257
- @alert ||= FinApps::REST::Alert.new self
258
- @alert_definition ||= FinApps::REST::AlertDefinition.new self
259
- @alert_settings ||= FinApps::REST::AlertSettings.new self
260
- @alert_preferences ||= FinApps::REST::AlertPreferences.new self
261
- @rule_sets ||= FinApps::REST::Relevance::Rulesets.new self
262
- end
263
-
264
- =======
265
- >>>>>>> develop
266
212
  end
267
213
  end
268
- end
214
+ end
@@ -18,13 +18,7 @@ module FinApps
18
18
  path = end_point.sub ':search_term', ERB::Util.url_encode(term)
19
19
  logger.debug "##{__method__.to_s} => path: #{path}"
20
20
 
21
- <<<<<<< HEAD
22
- institutions, error_messages = @client.send(path, :get)
23
- =======
24
- institutions, error_messages = @client.send_request(path, :get)
25
-
26
- logger.debug "##{__method__.to_s} => Completed"
27
- >>>>>>> develop
21
+ institutions, error_messages = client.send_request(path, :get)
28
22
  return institutions, error_messages
29
23
  end
30
24
 
@@ -39,13 +33,7 @@ module FinApps
39
33
  path = end_point.sub ':site_id', ERB::Util.url_encode(site_id)
40
34
  logger.debug "##{__method__.to_s} => path: #{path}"
41
35
 
42
- <<<<<<< HEAD
43
- institution, error_messages = @client.send(path, :get) { |r| Institution.new(r.body) }
44
- =======
45
- institution, error_messages = @client.send_request(path, :get) { |r| Institution.new(r.body) }
46
-
47
- logger.debug "##{__method__.to_s} => Completed"
48
- >>>>>>> develop
36
+ institution, error_messages = client.send_request(path, :get) { |r| Institution.new(r.body) }
49
37
  return institution, error_messages
50
38
  end
51
39
 
@@ -56,4 +44,4 @@ module FinApps
56
44
  end
57
45
 
58
46
  end
59
- end
47
+ end
@@ -5,6 +5,8 @@ module FinApps
5
5
  include FinApps::REST::Defaults
6
6
  include FinApps::Logging
7
7
 
8
+ attr_reader :client
9
+
8
10
  # @param [FinApps::REST::Client] client
9
11
  # @return [FinApps::REST::Resources]
10
12
  def initialize(client)
@@ -13,29 +13,19 @@ module FinApps
13
13
  path = end_point.sub ':transaction_id', ERB::Util.url_encode(transaction_id)
14
14
  logger.debug "##{__method__.to_s} => path: #{path}"
15
15
 
16
- <<<<<<< HEAD
17
- transaction, error_messages = @client.send(path, :get)
18
- =======
19
- transaction, error_messages = @client.send_request(path, :get)
20
-
21
- logger.debug "##{__method__.to_s} => Completed"
22
- >>>>>>> develop
16
+ transaction, error_messages = client.send_request(path, :get)
23
17
  return transaction, error_messages
24
18
  end
25
19
 
26
20
  # @param [Hash] params
27
21
  # @return [Array<Hash>, Array<String>]
28
22
  def search(params={})
29
- path = Defaults::END_POINTS[:transactions_list]
30
- logger.debug "##{__method__.to_s} => path: #{path}"
23
+ end_point = Defaults::END_POINTS[:transactions_list]
31
24
 
32
- <<<<<<< HEAD
33
- transactions, error_messages = @client.send(path, :post, params.compact)
34
- =======
35
- transactions, error_messages = @client.send_request(path, :post, params.compact)
25
+ path = end_point
26
+ logger.debug "##{__method__.to_s} => path: #{path}"
36
27
 
37
- logger.debug "##{__method__.to_s} => Completed"
38
- >>>>>>> develop
28
+ transactions, error_messages = client.send_request(path, :post, params.compact)
39
29
  return transactions, error_messages
40
30
  end
41
31
 
@@ -45,17 +35,11 @@ module FinApps
45
35
  path = Defaults::END_POINTS[:transactions_update]
46
36
  logger.debug "##{__method__.to_s} => path: #{path}"
47
37
 
48
- <<<<<<< HEAD
49
- _, error_messages = @client.send(path, :put, params.compact)
50
- =======
51
- _, error_messages = @client.send_request(path, :put, params.compact)
52
-
53
- logger.debug "##{__method__.to_s} => Completed"
54
- >>>>>>> develop
38
+ _, error_messages = client.send_request(path, :put, params.compact)
55
39
  error_messages
56
40
  end
57
41
 
58
42
  end
59
43
 
60
44
  end
61
- end
45
+ end
@@ -10,8 +10,7 @@ module FinApps
10
10
  path = Defaults::END_POINTS[:user_institutions_list]
11
11
  logger.debug "##{__method__.to_s} => path: #{path}"
12
12
 
13
- user_institutions, error_messages = @client.send_request(path, :get)
14
-
13
+ user_institutions, error_messages = client.send_request(path, :get)
15
14
  return user_institutions, error_messages
16
15
  end
17
16
 
@@ -29,8 +28,7 @@ module FinApps
29
28
  path = end_point.sub ':site_id', ERB::Util.url_encode(site_id)
30
29
  logger.debug "##{__method__.to_s} => path: #{path}"
31
30
 
32
- user_institution, error_messages = @client.send_request(path, :post, :parameters => parameters)
33
-
31
+ user_institution, error_messages = client.send_request(path, :post, :parameters => parameters)
34
32
  return user_institution, error_messages
35
33
  end
36
34
 
@@ -45,8 +43,7 @@ module FinApps
45
43
  path = end_point.sub ':user_institution_id', ERB::Util.url_encode(user_institution_id)
46
44
  logger.debug "##{__method__.to_s} => path: #{path}"
47
45
 
48
- user_institution, error_messages = @client.send_request(path, :get)
49
-
46
+ user_institution, error_messages = client.send_request(path, :get)
50
47
  return user_institution, error_messages
51
48
  end
52
49
 
@@ -60,8 +57,7 @@ module FinApps
60
57
  path = end_point.sub ':user_institution_id', ERB::Util.url_encode(user_institution_id)
61
58
  logger.debug "##{__method__.to_s} => path: #{path}"
62
59
 
63
- user_institution, error_messages = @client.send_request(path, :get)
64
-
60
+ user_institution, error_messages = client.send_request(path, :get)
65
61
  return user_institution, error_messages
66
62
  end
67
63
 
@@ -75,8 +71,7 @@ module FinApps
75
71
  path = end_point.sub ':user_institution_id', ERB::Util.url_encode(user_institution_id)
76
72
  logger.debug "##{__method__.to_s} => path: #{path}"
77
73
 
78
- user_institution, error_messages = @client.send_request(path, :get)
79
-
74
+ user_institution, error_messages = client.send_request(path, :get)
80
75
  return user_institution, error_messages
81
76
  end
82
77
 
@@ -93,8 +88,7 @@ module FinApps
93
88
  path = end_point.sub ':user_institution_id', ERB::Util.url_encode(user_institution_id)
94
89
  logger.debug "##{__method__.to_s} => path: #{path}"
95
90
 
96
- user_institution, error_messages = @client.send_request(path, :put, :parameters => parameters)
97
-
91
+ user_institution, error_messages = client.send_request(path, :put, :parameters => parameters)
98
92
  return user_institution, error_messages
99
93
  end
100
94
 
@@ -111,8 +105,7 @@ module FinApps
111
105
  path = end_point.sub ':user_institution_id', ERB::Util.url_encode(user_institution_id)
112
106
  logger.debug "##{__method__.to_s} => path: #{path}"
113
107
 
114
- user_institution, error_messages = @client.send_request(path, :put, :parameters => parameters)
115
-
108
+ user_institution, error_messages = client.send_request(path, :put, :parameters => parameters)
116
109
  return user_institution, error_messages
117
110
  end
118
111
 
@@ -120,8 +113,7 @@ module FinApps
120
113
  path = Defaults::END_POINTS[:user_institutions_refresh]
121
114
  logger.debug "##{__method__.to_s} => path: #{path}"
122
115
 
123
- user_institutions, error_messages = @client.send_request(path, :get)
124
-
116
+ user_institutions, error_messages = client.send_request(path, :get)
125
117
  return user_institutions, error_messages
126
118
  end
127
119
 
@@ -136,8 +128,7 @@ module FinApps
136
128
  path = end_point.sub ':user_institution_id', ERB::Util.url_encode(user_institution_id)
137
129
  logger.debug "##{__method__.to_s} => path: #{path}"
138
130
 
139
- _, error_messages = @client.send_request(path, :delete)
140
-
131
+ _, error_messages = client.send_request(path, :delete)
141
132
  error_messages
142
133
  end
143
134
 
@@ -19,82 +19,63 @@ module FinApps
19
19
  path = end_point.sub ':public_id', ERB::Util.url_encode(public_id)
20
20
  logger.debug "##{__method__.to_s} => path: #{path}"
21
21
 
22
- user, error_messages = @client.send_request(path, :get) { |r| User.new(r.body) }
23
-
22
+ user, error_messages = client.send_request(path, :get) { |r| User.new(r.body) }
24
23
  return user, error_messages
25
24
  end
26
25
 
27
26
  # @param [Hash] params
28
27
  # @return [FinApps::REST::User, Array<String>]
29
28
  def create(params = {})
30
- logger.debug "##{__method__.to_s} => Started"
31
-
32
29
  raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
33
30
  logger.debug "##{__method__.to_s} => params: #{skip_sensitive_data params}"
34
31
 
35
32
  end_point = Defaults::END_POINTS[:users_create]
36
33
  logger.debug "##{__method__.to_s} => end_point: #{end_point}"
37
34
 
38
- user, error_messages = @client.send_request(end_point, :post, params) { |r| User.new(r.body) }
39
- logger.debug "##{__method__.to_s} => Completed"
40
-
35
+ user, error_messages = client.send_request(end_point, :post, params) { |r| User.new(r.body) }
41
36
  return user, error_messages
42
37
  end
43
38
 
44
39
  # @param [Hash] params
45
40
  # @return [Array<String>]
46
41
  def update(params = {})
47
- logger.debug "##{__method__.to_s} => Started"
48
-
49
42
  logger.debug "##{__method__.to_s} => params: #{skip_sensitive_data params}"
50
43
 
51
44
  path = Defaults::END_POINTS[:users_update]
52
45
  logger.debug "##{__method__.to_s} => path: #{path}"
53
46
 
54
- _, error_messages = @client.send_request(path, :put, params.compact)
55
-
56
- logger.debug "##{__method__.to_s} => Completed"
47
+ _, error_messages = client.send_request(path, :put, params.compact)
57
48
  error_messages
58
49
  end
59
50
 
60
51
  # @param [Hash] params
61
52
  # @return [FinApps::REST::User, Array<String>]
62
53
  def update_password(params = {})
63
- logger.debug "##{__method__.to_s} => Started"
64
-
65
54
  logger.debug "##{__method__.to_s} => params: #{skip_sensitive_data params}"
66
55
 
67
56
  path = Defaults::END_POINTS[:users_update_password]
68
57
  logger.debug "##{__method__.to_s} => path: #{path}"
69
58
 
70
- user, error_messages = @client.send_request(path, :put, params.compact) { |r| User.new(r.body) }
71
- logger.debug "##{__method__.to_s} => Completed"
72
-
59
+ user, error_messages = client.send_request(path, :put, params.compact) { |r| User.new(r.body) }
73
60
  return user, error_messages
74
61
  end
75
62
 
76
63
  # @param [Hash] params
77
64
  # @return [FinApps::REST::User, Array<String>]
78
65
  def login(params = {})
79
- logger.debug "##{__method__.to_s} => Started"
80
-
81
66
  raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
82
67
  logger.debug "##{__method__.to_s} => params: #{skip_sensitive_data params}"
83
68
 
84
69
  end_point = Defaults::END_POINTS[:users_login]
85
70
  logger.debug "##{__method__.to_s} => end_point: #{end_point}"
86
71
 
87
- user, error_messages = @client.send_request(end_point, :post, params) { |r| User.new(r.body) }
88
- logger.debug "##{__method__.to_s} => Completed"
89
-
72
+ user, error_messages = client.send_request(end_point, :post, params) { |r| User.new(r.body) }
90
73
  return user, error_messages
91
74
  end
92
75
 
93
76
  # @param [String] public_id
94
77
  # @return [Array<String>]
95
78
  def delete(public_id)
96
- logger.debug "##{__method__.to_s} => Started"
97
-
98
79
  raise MissingArgumentsError.new 'Missing argument: public_id.' if public_id.blank?
99
80
  logger.debug "##{__method__.to_s} => public_id: #{public_id}"
100
81
 
@@ -104,9 +85,7 @@ module FinApps
104
85
  path = end_point.sub ':public_id', ERB::Util.url_encode(public_id)
105
86
  logger.debug "##{__method__.to_s} => path: #{path}"
106
87
 
107
- _, error_messages = @client.send_request(path, :delete)
108
- logger.debug "##{__method__.to_s} => Completed"
109
-
88
+ _, error_messages = client.send_request(path, :delete)
110
89
  error_messages
111
90
  end
112
91
 
@@ -1,3 +1,3 @@
1
1
  module FinApps
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
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: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero