finapps 0.12.4.pre → 0.12.5.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/budget_calculation.rb +5 -24
- data/lib/finapps/rest/defaults.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: b5fd4b0d6aa91c3abbeaff07e09d3a6f504435ac
|
4
|
+
data.tar.gz: a5ab9a3793e211a234c98cd625da117678fec610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16da377ece7f01c9a2d2c6f0b90afc017e5d4a5a128b8ba403314d0bc058391b36ee10746e1ebebdab361d270974d1b6d3acbfbeb48fb0c5c8a26b86adf76782
|
7
|
+
data.tar.gz: f8f41b490f5c53705b22ad15db360b4c8d36bbdc52e8d3c3f0a6ffa8e53344ab768531bec0827e9ae189714e5dbe5ae2d3797bb5fed63fe7bd47bb2539d6ded6
|
@@ -6,40 +6,21 @@ module FinApps
|
|
6
6
|
class BudgetCalculation < FinApps::REST::Resources
|
7
7
|
include FinApps::REST::Defaults
|
8
8
|
|
9
|
-
# @param [
|
10
|
-
# @return [Array<Hash>, Array<String>]
|
11
|
-
def create_old(params = {})
|
12
|
-
logger.debug "##{__method__.to_s} => Started"
|
13
|
-
|
14
|
-
raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
|
15
|
-
|
16
|
-
end_point = Defaults::END_POINTS[:budget_calculation_create]
|
17
|
-
logger.debug "##{__method__.to_s} => end_point: #{end_point}"
|
18
|
-
|
19
|
-
path = end_point
|
20
|
-
logger.debug "##{__method__.to_s} => path: #{path}"
|
21
|
-
|
22
|
-
budget_calculation, error_messages = @client.send(path, :post)
|
23
|
-
logger.debug "##{__method__.to_s} => Completed"
|
24
|
-
|
25
|
-
return budget_calculation, error_messages
|
26
|
-
end
|
27
|
-
|
28
|
-
# @param [String] budget_model
|
9
|
+
# @param [String] budget_model_id
|
29
10
|
# @param [Number] income
|
30
11
|
# @return [Array<Hash>, Array<String>]
|
31
|
-
def create(
|
12
|
+
def create(budget_model_id, income)
|
32
13
|
logger.debug "##{__method__.to_s} => Started"
|
33
14
|
|
34
|
-
raise MissingArgumentsError.new 'Missing argument:
|
35
|
-
logger.debug "##{__method__.to_s} => budget_model: #{
|
15
|
+
raise MissingArgumentsError.new 'Missing argument: budget_model_id.' if budget_model_id.blank?
|
16
|
+
logger.debug "##{__method__.to_s} => budget_model: #{budget_model_id}"
|
36
17
|
raise MissingArgumentsError.new 'Missing argument: income.' if income.blank?
|
37
18
|
logger.debug "##{__method__.to_s} => income: #{income}"
|
38
19
|
|
39
20
|
end_point = Defaults::END_POINTS[:budget_calculation_create]
|
40
21
|
logger.debug "##{__method__.to_s} => end_point: #{end_point}"
|
41
22
|
|
42
|
-
path = end_point.sub(':
|
23
|
+
path = end_point.sub(':budget_model_id', ERB::Util.url_encode(budget_model_id)).sub(':income', ERB::Util.url_encode(income))
|
43
24
|
logger.debug "##{__method__.to_s} => path: #{path}"
|
44
25
|
|
45
26
|
budget_calculation, error_messages = @client.send(path, :get)
|
@@ -49,7 +49,7 @@ module FinApps
|
|
49
49
|
:budget_models_list => 'budget/templates',
|
50
50
|
:budget_models_show => 'budget/template/:budget_model_id',
|
51
51
|
|
52
|
-
:budget_calculation_create => 'budget/template',
|
52
|
+
:budget_calculation_create => 'budget/template/:budget_model_id/:income',
|
53
53
|
:budget_calculation_show => 'categories',
|
54
54
|
|
55
55
|
:budget_update => 'budget',
|
data/lib/finapps/version.rb
CHANGED