Class: Belvo::Owner

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

Overview

An Owner represents the person who has access to a Link and is the owner of all the Accounts inside the Link

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) ⇒ Owner

Returns a new instance of Owner.



225
226
227
228
# File 'lib/belvo/resources.rb', line 225

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

Instance Method Details

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

Retrieve owners from an existing link

Parameters:

  • link (String)

    Link UUID

  • options (OwnerOptions) (defaults to: nil)

    Configurable properties

Returns:

  • (Hash)

    created owners details

Raises:



235
236
237
238
239
240
241
242
243
244
# File 'lib/belvo/resources.rb', line 235

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