Class: GoCardlessPro::Resources::FundsAvailability

Inherits:
Object
  • Object
show all
Defined in:
lib/gocardless_pro/resources/funds_availability.rb

Overview

Checks if the payer's current balance is sufficient to cover the amount the merchant wants to charge within the consent parameters defined on the mandate.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ FundsAvailability

Initialize a funds_availability resource instance

Parameters:

  • object (Hash)

    an object returned from the API



21
22
23
24
25
26
# File 'lib/gocardless_pro/resources/funds_availability.rb', line 21

def initialize(object, response = nil)
  @object = object

  @available = object['available']
  @response = response
end

Instance Attribute Details

#availableObject (readonly)

Returns the value of attribute available.



17
18
19
# File 'lib/gocardless_pro/resources/funds_availability.rb', line 17

def available
  @available
end

Instance Method Details

#api_responseObject



28
29
30
# File 'lib/gocardless_pro/resources/funds_availability.rb', line 28

def api_response
  ApiResponse.new(@response)
end

#to_hObject

Provides the funds_availability resource as a hash of all its readable attributes



33
34
35
# File 'lib/gocardless_pro/resources/funds_availability.rb', line 33

def to_h
  @object
end