Class: LunchMoney::Calls::PlaidAccounts

Inherits:
Base
  • Object
show all
Defined in:
lib/lunchmoney/calls/plaid_accounts.rb

Overview

Constant Summary

Constants inherited from Base

Base::BASE_URL

Instance Attribute Summary

Attributes inherited from Base

#api_key

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from LunchMoney::Calls::Base

Instance Method Details

#plaid_accountsObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/lunchmoney/calls/plaid_accounts.rb', line 11

def plaid_accounts
  response = get("plaid_accounts")

  api_errors = errors(response)
  return api_errors if api_errors.present?

  response.body[:plaid_accounts].map do ||
    LunchMoney::Objects::PlaidAccount.new(**)
  end
end

#plaid_accounts_fetch(start_date: nil, end_date: nil, plaid_account_id: nil) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/lunchmoney/calls/plaid_accounts.rb', line 29

def plaid_accounts_fetch(start_date: nil, end_date: nil, plaid_account_id: nil)
  params = clean_params({ start_date:, end_date:, plaid_account_id: })
  response = post("plaid_accounts/fetch", params)

  api_errors = errors(response)
  return api_errors if api_errors.present?

  response.body
end