Class: Belvo::RecurringExpenses

Inherits:
Resource
  • Object
show all
Defined in:
lib/belvo/resources.rb

Overview

Recurring Expenses contain a resume of one year of Transactions inside an Account.

Instance Attribute Summary

Attributes inherited from Resource

#endpoint

Instance Method Summary collapse

Methods inherited from Resource

#clean, #delete, #detail, #list, #resume

Constructor Details

#initialize(session) ⇒ RecurringExpenses

Returns a new instance of RecurringExpenses.



366
367
368
369
# File 'lib/belvo/resources.rb', line 366

def initialize(session)
  super(session)
  @endpoint = 'api/recurring-expenses/'
end

Instance Method Details

#retrieve(link:, options: nil) ⇒ Hash

Retrieve recurring expenses information from a specific banking link

Parameters:

Returns:

  • (Hash)

    created RecurringExpenses details

Raises:



376
377
378
379
380
381
382
383
384
# File 'lib/belvo/resources.rb', line 376

def retrieve(link:, options: nil)
  options = RecurringExpensesOptions.from(options)
  body = {
    link: link,
    save_data: options.save_data || true
  }.merge(options)
  body = clean body: body
  @session.post(@endpoint, body)
end