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