Class: Belvo::InvestmentsPortfolio

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

Overview

A InvestmentsPortfolio is a comprehensive view of your user’s current investment holdings

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

Returns a new instance of InvestmentsPortfolio.



630
631
632
633
# File 'lib/belvo/resources.rb', line 630

def initialize(session)
  super(session)
  @endpoint = 'investments/portfolios/'
end

Instance Method Details

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

Retrieve investments portfolios from an existing link

Parameters:

Returns:

  • (Hash)

    created investments portfolios details

Raises:



640
641
642
643
644
645
646
647
648
649
# File 'lib/belvo/resources.rb', line 640

def retrieve(link:, options: nil)
  options = InvestmentsPortfolioOptions.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