Sha256: 0bddda0641dc271e99fa51c48e4d3c77cf1767fd7aee58205780cc8b711e52dc

Contents?: true

Size: 950 Bytes

Versions: 12

Compression:

Stored size: 950 Bytes

Contents

require 'credit_card_validations/version'
require 'credit_card_validations/error'
require 'active_model'
require 'active_support/core_ext'
require 'active_model/validations'
require 'active_model/credit_card_number_validator'
require 'yaml'

module CreditCardValidations
  extend ActiveSupport::Autoload
  autoload :VERSION, 'credit_card_validations/version'
  autoload :Luhn, 'credit_card_validations/luhn'
  autoload :Detector, 'credit_card_validations/detector'
  autoload :Factory, 'credit_card_validations/factory'
  autoload :Mmi, 'credit_card_validations/mmi'


  def self.add_brand(key, rules, options = {})
    Detector.add_brand(key, rules, options)
  end

  DATA = YAML.load_file(File.join(File.dirname(__FILE__),  'data', 'brands.yaml')) || {}

  def self.reload!
    Detector.brands = {}
    DATA.each do |key, data|
      add_brand(key, data.fetch(:rules), data.fetch(:options, {}))
    end
  end

end

CreditCardValidations.reload!



Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
credit_card_validations-5.0.0 lib/credit_card_validations.rb
credit_card_validations-4.1.0 lib/credit_card_validations.rb
credit_card_validations-4.0.0 lib/credit_card_validations.rb
credit_card_validations-3.5.1 lib/credit_card_validations.rb
credit_card_validations-3.5.0 lib/credit_card_validations.rb
cw_credit_card_validations-3.4.0 lib/credit_card_validations.rb
credit_card_validations-3.4.0 lib/credit_card_validations.rb
credit_card_validations-3.3.0 lib/credit_card_validations.rb
credit_card_validations-3.2.2 lib/credit_card_validations.rb
credit_card_validations-3.2.1 lib/credit_card_validations.rb
credit_card_validations-3.1.0 lib/credit_card_validations.rb
credit_card_validations-3.0.0 lib/credit_card_validations.rb