Class: Ibanizator::Iban::ExtendedData::DE
- Inherits:
-
Object
- Object
- Ibanizator::Iban::ExtendedData::DE
- Includes:
- Adamantium
- Defined in:
- lib/ibanizator/iban/extended_data/de.rb
Instance Attribute Summary collapse
-
#iban ⇒ Object
readonly
Returns the value of attribute iban.
Instance Method Summary collapse
- #account_number ⇒ Object
- #bank_code ⇒ Object
- #bank_name ⇒ Object
- #bic ⇒ Object
-
#initialize(iban) ⇒ DE
constructor
A new instance of DE.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
Instance Attribute Details
#iban ⇒ Object (readonly)
Returns the value of attribute iban.
5 6 7 |
# File 'lib/ibanizator/iban/extended_data/de.rb', line 5 def iban @iban end |
Instance Method Details
#account_number ⇒ Object
19 20 21 |
# File 'lib/ibanizator/iban/extended_data/de.rb', line 19 def account_number iban.to_s[12..-1].gsub(/\A0+/,"") end |
#bank_code ⇒ Object
14 15 16 |
# File 'lib/ibanizator/iban/extended_data/de.rb', line 14 def bank_code iban.to_s[4..11] end |
#bank_name ⇒ Object
28 29 30 |
# File 'lib/ibanizator/iban/extended_data/de.rb', line 28 def bank_name bank.name end |
#bic ⇒ Object
24 25 26 |
# File 'lib/ibanizator/iban/extended_data/de.rb', line 24 def bic bank.bic end |
#to_hash ⇒ Object Also known as: to_h
32 33 34 35 36 37 38 39 |
# File 'lib/ibanizator/iban/extended_data/de.rb', line 32 def to_hash { bank_code: bank_code, account_number: account_number, bic: bic, bank_name: bank_name, } end |