Sha256: eb94ed52ac20005300ea0662e48fc94f1ad8347d7b0be8ed5453f250cc3fa372
Contents?: true
Size: 763 Bytes
Versions: 16
Compression:
Stored size: 763 Bytes
Contents
require 'json' require "zengin_code/version" require 'zengin_code/bank' require 'zengin_code/branch' module ZenginCode class << self def preload! banks = JSON.load(File.read(DATA_DIR.join('banks.json'))) banks.values.each do |bank| ZenginCode::Bank.new(bank['code'], bank['name'], bank['kana'], bank['hira'], bank['roma']) end ZenginCode::Bank.all.each_pair do |code, bank| branches = JSON.load(File.read(DATA_DIR.join("branches/#{code}.json"))) branches.values.each do |branch| branch = ZenginCode::Branch.new(bank, branch['code'], branch['name'], branch['kana'], branch['hira'], branch['roma']) bank.branches[branch.code] = branch end end end end preload! end
Version data entries
16 entries across 16 versions & 1 rubygems