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.



195
196
197
198
# File 'lib/belvo/resources.rb', line 195

def initialize(session)
  super(session)
  @endpoint = '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:



205
206
207
208
209
210
211
212
213
214
215
# File 'lib/belvo/resources.rb', line 205

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