lib/finapps/rest/budget_calculation.rb in finapps-1.0.3 vs lib/finapps/rest/budget_calculation.rb in finapps-1.0.4
- old
+ new
@@ -4,52 +4,42 @@
require 'erb'
class BudgetCalculation < FinApps::REST::Resources
include FinApps::REST::Defaults
+ # Creates a new Budget Calculation for the given user, using a budget template
+ # matching budget_model_id and teh given income amount.
# @param [String] budget_model_id
# @param [Number] income
# @return [Array<Hash>, Array<String>]
def create(budget_model_id, income)
raise MissingArgumentsError.new 'Missing argument: budget_model_id.' if budget_model_id.blank?
logger.debug "##{__method__.to_s} => budget_model: #{budget_model_id}"
-
raise MissingArgumentsError.new 'Missing argument: income.' if income.blank?
logger.debug "##{__method__.to_s} => income: #{income}"
end_point = Defaults::END_POINTS[:budget_calculation_create]
logger.debug "##{__method__.to_s} => end_point: #{end_point}"
path = end_point.sub(':budget_model_id', ERB::Util.url_encode(budget_model_id)).sub(':income', ERB::Util.url_encode(income))
logger.debug "##{__method__.to_s} => path: #{path}"
-<<<<<<< HEAD
- budget_calculation, error_messages = @client.send(path, :get)
-=======
- budget_calculation, error_messages = @client.send_request(path, :get)
- logger.debug "##{__method__.to_s} => Completed"
-
->>>>>>> develop
+ budget_calculation, error_messages = client.send_request(path, :get)
return budget_calculation, error_messages
end
+ # Shows the Budget Calculation for the given user.
# @return [Array<Hash>, Array<String>]
def show
end_point = Defaults::END_POINTS[:budget_calculation_show]
logger.debug "##{__method__.to_s} => end_point: #{end_point}"
path = end_point
logger.debug "##{__method__.to_s} => path: #{path}"
-<<<<<<< HEAD
- budget_calculation, error_messages = @client.send(path, :get)
-=======
- budget_calculation, error_messages = @client.send_request(path, :get)
- logger.debug "##{__method__.to_s} => Completed"
-
->>>>>>> develop
+ budget_calculation, error_messages = client.send_request(path, :get)
return budget_calculation, error_messages
end
end
end
-end
+end
\ No newline at end of file