Class: Belvo::Income

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

Overview

A Income contains a resume of monthly 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) ⇒ Income

Returns a new instance of Income.



309
310
311
312
# File 'lib/belvo/resources.rb', line 309

def initialize(session)
  super(session)
  @endpoint = 'api/incomes/'
end

Instance Method Details

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

Retrieve incomes information from a specific banking link.

Parameters:

  • link (String)

    Link UUID

  • options (IncomesOptions) (defaults to: nil)

    Configurable properties

Returns:

  • (Hash)

    created incomes details

Raises:



319
320
321
322
323
324
325
326
327
328
329
# File 'lib/belvo/resources.rb', line 319

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