Class: Belvo::EmploymentRecords

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

Overview

Employment records

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

Returns a new instance of EmploymentRecords.



654
655
656
657
# File 'lib/belvo/resources.rb', line 654

def initialize(session)
  super(session)
  @endpoint = 'api/employment-records/'
end

Instance Method Details

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

Retrieve employment records from an existing government link

Parameters:

Returns:

  • (Hash)

    created employment records details

Raises:



664
665
666
667
668
669
670
671
672
673
674
# File 'lib/belvo/resources.rb', line 664

def retrieve(link:, options: nil)
  options = EmploymentRecordsOptions.from(options)
  body = {
    link: link,
    save_data: options.save_data || true,
    attach_pdf: options.attach_pdf
  }.merge(options)

  body = clean body: body
  @session.post(@endpoint, body)
end