Sha256: 4dcb37704e285344fcf053dc3be96e33bcbbf64fb0e011a89e3ce1910bc9c701

Contents?: true

Size: 898 Bytes

Versions: 1

Compression:

Stored size: 898 Bytes

Contents

# frozen_string_literal: true

require "yaml"
require_relative "company_number/version"
require_relative "company_number/validation"

module CompanyNumber
  autoload :Configuration, "company_number/configuration"
  autoload :Dictionary,    "company_number/dictionary"
  autoload :Number,        "company_number/number"

  class << self
    def parse(company_number, country_code = nil)
      CompanyNumber::Number.new(company_number, country_code)
    end

    def configuration
      @_configuration ||= CompanyNumber::Configuration.new
    end

    def configure
      yield configuration
    end

    def dictionary
      configuration.dictionary.values
    end

    def excluded_countries
      configuration.excluded_countries
    end

    def custom_dictionary
      configuration.custom_dictionary
    end

    def strict_validation?
      configuration.strict_validation?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
company_number-0.1.3 lib/company_number.rb