Class: BSB::BankListGenerator

Inherits:
BaseGenerator show all
Defined in:
lib/bsb/bank_list_generator.rb

Instance Attribute Summary

Attributes inherited from BaseGenerator

#hash

Class Method Summary collapse

Methods inherited from BaseGenerator

#initialize, #json

Constructor Details

This class inherits a constructor from BSB::BaseGenerator

Class Method Details

.load_file(filename) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/bsb/bank_list_generator.rb', line 8

def self.load_file(filename)
  hash = {}
  CSV.foreach(filename) do |row|
    row[2].split(', ').each do |prefix|
      prefix = prefix.chomp.rjust(2, '0')
      hash[prefix] = row[1]
    end
  end
  new(hash)
end