Sha256: 366ad46db17b1b2ef7fd4bf5599e655acae8e619caa93267c51943c2bc1dd6cc

Contents?: true

Size: 1.18 KB

Versions: 7

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

require "i18n"
require "ibandit/version"
require "ibandit/errors"
require "ibandit/constants"
require "ibandit/iban"
require "ibandit/german_details_converter"
require "ibandit/sweden/local_details_converter"
require "ibandit/sweden/validator"
require "ibandit/sweden/bank_lookup"
require "ibandit/iban_splitter"
require "ibandit/iban_assembler"
require "ibandit/pseudo_iban_assembler"
require "ibandit/pseudo_iban_splitter"
require "ibandit/local_details_cleaner"
require "ibandit/check_digit"

I18n.load_path += Dir[File.expand_path("../config/locales/*.{rb,yml}",
                                       __dir__)]

module Ibandit
  class << self
    attr_accessor :bic_finder, :modulus_checker

    def find_bic(country_code, national_id)
      raise NotImplementedError, "BIC finder is not defined" unless @bic_finder

      @bic_finder.call(country_code, national_id)
    end

    def structures
      @structures ||= YAML.safe_load(
        File.read(File.expand_path("../data/structures.yml", __dir__)),
        permitted_classes: [Range, Symbol],
      )
    end

    def translate(key, options = {})
      I18n.translate(key, scope: [:ibandit], **options)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ibandit-1.14.0 lib/ibandit.rb
ibandit-1.13.0 lib/ibandit.rb
ibandit-1.12.0 lib/ibandit.rb
ibandit-1.11.0 lib/ibandit.rb
ibandit-1.10.0 lib/ibandit.rb
ibandit-1.9.0 lib/ibandit.rb
ibandit-1.8.1 lib/ibandit.rb