Sha256: 4f81acee406f71e5fbc33a915fba6d6a293f36a2703872e2bafd8d117653ca04

Contents?: true

Size: 573 Bytes

Versions: 2

Compression:

Stored size: 573 Bytes

Contents

module BootstrapValidatorRails
  module Validators
    class Generator
      def initialize(record, validator, method)
        @record, @validator, @method = record, validator, method
        @kind = validator.kind
        p @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

2 entries across 2 versions & 1 rubygems

Version Path
bootstrap_validator_rails-0.5.1 lib/bootstrap_validator_rails/validators/generator.rb
bootstrap_validator_rails-0.5.0 lib/bootstrap_validator_rails/validators/generator.rb