Class: BankingData::GermanBank

Inherits:
Bank
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/banking_data/german_bank.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Bank

only, where

Instance Attribute Details

#bicObject

Returns the value of attribute bic.



6
7
8
# File 'lib/banking_data/german_bank.rb', line 6

def bic
  @bic
end

#blzObject

Returns the value of attribute blz.



6
7
8
# File 'lib/banking_data/german_bank.rb', line 6

def blz
  @blz
end

Class Method Details

.allObject



8
9
10
# File 'lib/banking_data/german_bank.rb', line 8

def self.all
  @@all ||= get_all
end

.fileObject



22
23
24
# File 'lib/banking_data/german_bank.rb', line 22

def self.file
  File.dirname(__FILE__) + '/../../data/BLZ_20130909.txt'
end

.get_allObject



12
13
14
15
16
17
18
19
20
# File 'lib/banking_data/german_bank.rb', line 12

def self.get_all
  banks = []
  File.open(file).each_line do |line|
    blz = line[0..7]
    bic = line[139..149]
    banks << new(bic: bic, blz: blz)
  end
  banks
end