Sha256: c1d2c2d1805a182038de9b1b0eb1906b77701ae7b87b71bf39cc577db47dedc5

Contents?: true

Size: 360 Bytes

Versions: 1

Compression:

Stored size: 360 Bytes

Contents

require "mxn_banks/version"

module MxnBanks
  autoload :Bank, 'mxn_banks/bank'
  def self.from_iban(num)
    a = to_hash.select { |b| b[:number] == num.slice(0, 3) }
    Bank.new(a.first)
  end

  def self.to_hash
    json_file = File.read(File.join(File.dirname(__FILE__), 'banks.json'))
    @banks ||= JSON.parse(json_file, symbolize_names: true)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mxn_banks-0.1.1 lib/mxn_banks.rb