class GoCardless::Resources::CustomerBankAccount
# Note that customer bank accounts must be unique, and so you will encounter a ‘bank_account_exists` error if you try to create a duplicate bank account. You may wish to handle this by updating the existing record instead, the ID of which will be provided as links in the error response. Represents an instance of a customer_bank_account resource returned from the API
Attributes
account_holder_name[R]
account_number_ending[R]
bank_name[R]
country_code[R]
created_at[R]
currency[R]
enabled[R]
id[R]
metadata[R]
Public Class Methods
new(object)
click to toggle source
initialize a resource instance @param object [Hash] an object returned from the API
# File lib/gocardless-pro/resources/customer_bank_account.rb, line 48 def initialize(object) @object = object @account_holder_name = object['account_holder_name'] @account_number_ending = object['account_number_ending'] @bank_name = object['bank_name'] @country_code = object['country_code'] @created_at = object['created_at'] @currency = object['currency'] @enabled = object['enabled'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] end
Public Instance Methods
links()
click to toggle source
return the links that the resource has
# File lib/gocardless-pro/resources/customer_bank_account.rb, line 64 def links Struct.new( *{ customer: '' }.keys.sort ).new(*@links.sort.map(&:last)) end
to_h()
click to toggle source
Provides the resource as a hash of all it’s readable attributes
# File lib/gocardless-pro/resources/customer_bank_account.rb, line 75 def to_h @object end