Sha256: fa559e812a9936cfd23d62ea4592f073fc8d834c9d5500fe3e0ce09a51c84118

Contents?: true

Size: 436 Bytes

Versions: 11

Compression:

Stored size: 436 Bytes

Contents

module Judge
  module EachValidator

    require 'set'

    def self.included(base)
      base.send(:cattr_accessor, :messages_to_lookup) { Set.new }
      base.send(:extend, ClassMethods)
    end

    module ClassMethods

      def uses_messages(*keys)
        self.messages_to_lookup.merge(keys)
      end

    end

  end
end

::ActiveModel::EachValidator.send(:include, Judge::EachValidator) if defined?(::ActiveModel::EachValidator)

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
judge-3.1.0 lib/judge/each_validator.rb
judge-3.0.0 lib/judge/each_validator.rb
judge-2.1.1 lib/judge/each_validator.rb
judge-2.1.0 lib/judge/each_validator.rb
judge-2.0.6 lib/judge/each_validator.rb
judge-2.0.5 lib/judge/each_validator.rb
judge-2.0.4 lib/judge/each_validator.rb
judge-2.0.3 lib/judge/each_validator.rb
judge-2.0.2 lib/judge/each_validator.rb
judge-2.0.1 lib/judge/each_validator.rb
judge-2.0.0 lib/judge/each_validator.rb