Class: BankingData::AustrianBank

Inherits:
Bank
  • Object
show all
Extended by:
ActiveModel::Naming
Includes:
ActiveModel::AttributeMethods, ActiveModel::Conversion
Defined in:
lib/banking_data/austrian_bank.rb

Constant Summary collapse

LOCALE =
:at

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Bank

#initialize, query, where

Constructor Details

This class inherits a constructor from BankingData::Bank

Instance Attribute Details

#bic ⇒ Object

Returns the value of attribute bic.



11
12
13
# File 'lib/banking_data/austrian_bank.rb', line 11

def bic
  @bic
end

#blz ⇒ Object

Returns the value of attribute blz.



11
12
13
# File 'lib/banking_data/austrian_bank.rb', line 11

def blz
  @blz
end

Class Method Details

.all ⇒ Object



17
18
19
# File 'lib/banking_data/austrian_bank.rb', line 17

def all
  @@all ||= get_all
end

.get_all ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/banking_data/austrian_bank.rb', line 21

def get_all
  banks = []
  SmarterCSV.process(file, opts).each do |line|
    if line[:kennzeichen] == 'Hauptanstalt'
      blz = line[:bankleitzahl].try(:gsub, /"/, '')
      bic = line[:'swift-code'].try(:gsub, /"/, '')
      banks << new(bic: bic, blz: blz)
    end
  end
  banks
end