class Belvo::Income

A Income contains a resume of monthly Transactions inside an Account.

Public Class Methods

new(session) click to toggle source
Calls superclass method Belvo::Resource::new
# File lib/belvo/resources.rb, line 298
def initialize(session)
  super(session)
  @endpoint = 'incomes/'
end

Public Instance Methods

retrieve(link:, options: nil) click to toggle source

Retrieve incomes information from a specific banking link. @param link [String] Link UUID @param options [IncomesOptions] Configurable properties @return [Hash] created incomes details @raise [RequestError] If response code is different than 2XX

# File lib/belvo/resources.rb, line 308
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