Class: ActiveModel::BlockValidator
- Inherits:
-
EachValidator
- Object
- Validator
- EachValidator
- ActiveModel::BlockValidator
- Defined in:
- activemodel/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 inherited from Validator
Instance Method Summary collapse
-
#initialize(options, &block) ⇒ BlockValidator
constructor
A new instance of BlockValidator.
Methods inherited from EachValidator
Methods inherited from Validator
Constructor Details
#initialize(options, &block) ⇒ BlockValidator
Returns a new instance of BlockValidator.
173 174 175 176 |
# File 'activemodel/lib/active_model/validator.rb', line 173 def initialize(, &block) @block = block super end |