Sha256: 59d5f7c613de108e00255af27421b17ea362e40cde07b1d8493299308a471931
Contents?: true
Size: 631 Bytes
Versions: 3
Compression:
Stored size: 631 Bytes
Contents
module BootstrapValidatorRails module Validators class Generator VALIDATOR_SUPPORTED = [:presence, :numericality, :length, :format] def initialize(record, validator, method) @record, @validator, @method = record, validator, method @kind = validator.kind end def generate_data(options = {}) return {} unless VALIDATOR_SUPPORTED.include?(@kind) klass = "BootstrapValidatorRails::Validators::#{@kind.to_s.capitalize}".constantize bootstrap_validator = klass.new(@record, @method, @validator) bootstrap_validator.generate_data end end end end
Version data entries
3 entries across 3 versions & 1 rubygems