class BSB::BankListGenerator

Public Class Methods

load_file(filename) click to toggle source
# File lib/bsb/bank_list_generator.rb, line 15
def self.load_file(filename)
  client = ::Auspaynet::Client.new('bsb.hostedftp.com')
  content = client.get('~auspaynetftp/BSB', filename)
  hash = {}
  CSV.parse(content) do |row|
    row[2].split(", ").each do |prefix|
      prefix = prefix.chomp.rjust(2, "0")
      hash[prefix] = row[1]
    end
  end
  new(hash)
end
new(hash) click to toggle source
# File lib/bsb/bank_list_generator.rb, line 7
def initialize(hash)
  @hash = hash
end

Public Instance Methods

json() click to toggle source
# File lib/bsb/bank_list_generator.rb, line 11
def json
  JSON.dump(@hash)
end