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



232
233
234
235
# File 'lib/belvo/resources.rb', line 232

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

Instance Method Details

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

Retrieve owners from an existing link

Raises:



242
243
244
245
246
247
248
249
250
251
# File 'lib/belvo/resources.rb', line 242

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