Class: Belvo::Balance
Overview
A Balance represents the financial status of an Account at a given time.
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(session) ⇒ Balance
constructor
A new instance of Balance.
-
#retrieve(link:, date_from:, options: nil) ⇒ Hash
Retrieve balances from a specific account or all accounts from a specific link.
Methods inherited from Resource
#clean, #delete, #detail, #list, #resume
Constructor Details
#initialize(session) ⇒ Balance
Returns a new instance of Balance.
249 250 251 252 |
# File 'lib/belvo/resources.rb', line 249 def initialize(session) super(session) @endpoint = 'api/balances/' end |
Instance Method Details
#retrieve(link:, date_from:, options: nil) ⇒ Hash
Retrieve balances from a specific account or all accounts from a
specific link
261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/belvo/resources.rb', line 261 def retrieve(link:, date_from:, options: nil) = BalanceOptions.from() date_to = .date_to || Date.today.to_s body = { link: link, date_from: date_from, date_to: date_to, token: .token, account: .account, save_data: .save_data || true }.merge() body = clean body: body @session.post(@endpoint, body) end |