Class: BankingData::SwissBank
- Includes:
- ActiveModel::Model
- Defined in:
- lib/banking_data/swiss_bank.rb
Instance Attribute Summary collapse
-
#bic ⇒ Object
Returns the value of attribute bic.
Class Method Summary collapse
Methods inherited from Bank
Instance Attribute Details
#bic ⇒ Object
Returns the value of attribute bic.
6 7 8 |
# File 'lib/banking_data/swiss_bank.rb', line 6 def bic @bic end |
Class Method Details
.all ⇒ Object
8 9 10 |
# File 'lib/banking_data/swiss_bank.rb', line 8 def self.all @@all ||= get_all end |
.file ⇒ Object
24 25 26 |
# File 'lib/banking_data/swiss_bank.rb', line 24 def self.file File.dirname(__FILE__) + '/../../data/bcbankenstamm.txt' end |
.get_all ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/banking_data/swiss_bank.rb', line 12 def self.get_all banks = [] File.read(file, encoding: 'iso-8859-1').lines.each do |line| kennzeichen = line[7..10] if kennzeichen == '0000' bic = line[284..294] banks << new(bic: bic) end end banks end |