Class: LunchMoney::Calls::RecurringExpenses
- Defined in:
- lib/lunchmoney/calls/recurring_expenses.rb
Overview
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from LunchMoney::Calls::Base
Instance Method Details
#recurring_expenses(start_date: nil, end_date: nil) ⇒ Array<LunchMoney::Objects::RecurringExpense>, LunchMoney::Errors
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/lunchmoney/calls/recurring_expenses.rb', line 16 def recurring_expenses(start_date: nil, end_date: nil) params = clean_params({ start_date:, end_date: }) response = get("recurring_expenses", query_params: params) api_errors = errors(response) return api_errors if api_errors.present? response.body[:recurring_expenses].map do |recurring_expense| LunchMoney::Objects::RecurringExpense.new(**recurring_expense) end end |