Class: SixSaferpay::BankAccount

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/models/bank_account.rb

Direct Known Subclasses

Payee

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(iban:, holder_name: nil, bic: nil, bank_name: nil, country_code: nil) ⇒ BankAccount

Returns a new instance of BankAccount.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/six_saferpay/models/bank_account.rb', line 11

def initialize(iban:,
               holder_name: nil,
               bic: nil,
               bank_name: nil,
               country_code: nil
              )
  @iban = iban
  @holder_name = holder_name
  @bic = bic
  @bank_name = bank_name
  @country_code = country_code
end

Instance Attribute Details

#bank_nameObject

Returns the value of attribute bank_name.



4
5
6
# File 'lib/six_saferpay/models/bank_account.rb', line 4

def bank_name
  @bank_name
end

#bicObject

Returns the value of attribute bic.



4
5
6
# File 'lib/six_saferpay/models/bank_account.rb', line 4

def bic
  @bic
end

#country_codeObject

Returns the value of attribute country_code.



4
5
6
# File 'lib/six_saferpay/models/bank_account.rb', line 4

def country_code
  @country_code
end

#holder_nameObject

Returns the value of attribute holder_name.



4
5
6
# File 'lib/six_saferpay/models/bank_account.rb', line 4

def holder_name
  @holder_name
end

#ibanObject

Returns the value of attribute iban.



4
5
6
# File 'lib/six_saferpay/models/bank_account.rb', line 4

def iban
  @iban
end

Instance Method Details

#to_hashObject Also known as: to_h



24
25
26
27
28
29
30
31
32
# File 'lib/six_saferpay/models/bank_account.rb', line 24

def to_hash
  hash = Hash.new
  hash.merge!(iban: @iban) if @iban
  hash.merge!(holder_name: @holder_name) if @holder_name
  hash.merge!(bic: @bic) if @bic
  hash.merge!(bank_name: @bank_name)
  hash.merge!(country_code: @country_code)
  hash
end