Class: GoCardlessPro::Resources::BankDetailsLookup

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

Overview

Look up the name and reachability of a bank account.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ BankDetailsLookup

Initialize a bank_details_lookup resource instance

Parameters:

  • object (Hash)

    an object returned from the API



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

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

  @available_debit_schemes = object['available_debit_schemes']
  @bank_name = object['bank_name']
  @bic = object['bic']
  @response = response
end

Instance Attribute Details

#available_debit_schemesObject (readonly)

Returns the value of attribute available_debit_schemes.



15
16
17
# File 'lib/gocardless_pro/resources/bank_details_lookup.rb', line 15

def available_debit_schemes
  @available_debit_schemes
end

#bank_nameObject (readonly)

Returns the value of attribute bank_name.



15
16
17
# File 'lib/gocardless_pro/resources/bank_details_lookup.rb', line 15

def bank_name
  @bank_name
end

#bicObject (readonly)

Returns the value of attribute bic.



15
16
17
# File 'lib/gocardless_pro/resources/bank_details_lookup.rb', line 15

def bic
  @bic
end

Instance Method Details

#api_responseObject



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

def api_response
  ApiResponse.new(@response)
end

#to_hObject

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



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

def to_h
  @object
end