Class: ActiveModel::BlockValidator

Inherits:
EachValidator show all
Defined in:
lib/active_model/validator.rb

Overview

BlockValidator is a special EachValidator which receives a block on initialization and call this block for each attribute being validated. validates_each uses this validator.

Instance Attribute Summary

Attributes inherited from EachValidator

#attributes

Attributes inherited from Validator

#options

Instance Method Summary collapse

Methods inherited from EachValidator

#check_validity!, #validate

Methods inherited from Validator

kind, #kind, #validate

Constructor Details

#initialize(options, &block) ⇒ BlockValidator

:nodoc:



180
181
182
183
# File 'lib/active_model/validator.rb', line 180

def initialize(options, &block)
  @block = block
  super
end