class GoCardlessPro::Resources::Balance
Returns the balances for a creditor. These balances are the same as what’s shown in the dashboard with one exception (mentioned below under balance_type
).
These balances will typically be 3-5 minutes old. The balance amounts likely won’t match what’s shown in the dashboard as the dashboard balances are updated much less frequently (once per day).
Attributes
Public Class Methods
Source
# File lib/gocardless_pro/resources/balance.rb, line 25 def initialize(object, response = nil) @object = object @amount = object['amount'] @balance_type = object['balance_type'] @currency = object['currency'] @last_updated_at = object['last_updated_at'] @links = object['links'] @response = response end
Initialize a balance resource instance @param object [Hash] an object returned from the API
Public Instance Methods
Source
# File lib/gocardless_pro/resources/balance.rb, line 36 def api_response ApiResponse.new(@response) end
Source
# File lib/gocardless_pro/resources/balance.rb, line 41 def links @balance_links ||= Links.new(@links) end
Return the links that the resource has
Source
# File lib/gocardless_pro/resources/balance.rb, line 46 def to_h @object end
Provides the balance resource as a hash of all its readable attributes