Class: ActiveModel::BlockValidator

Inherits:
EachValidator show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.4/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:



178
179
180
181
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activemodel-7.0.4/lib/active_model/validator.rb', line 178

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