Class: BankingData::AustrianBank

Inherits:
Bank
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/banking_data/austrian_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.



7
8
9
# File 'lib/banking_data/austrian_bank.rb', line 7

def bic
  @bic
end

Class Method Details

.allObject



9
10
11
# File 'lib/banking_data/austrian_bank.rb', line 9

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

.fileObject



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

def self.file
  File.dirname(__FILE__) +
    '/../../data/kiverzeichnis_gesamt_de_1381499802577.csv'
end

.get_allObject



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

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

.optsObject



27
28
29
30
31
32
33
# File 'lib/banking_data/austrian_bank.rb', line 27

def self.opts
  {
    col_sep: ';',
    file_encoding: 'iso-8859-1',
    force_simple_split: true
  }
end