Class: Serega::SeregaPlugins::Metadata::MetaAttribute::CheckBlock
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::Metadata::MetaAttribute::CheckBlock
- Defined in:
- lib/serega/plugins/metadata/validations/check_block.rb
Overview
Validator for meta_attribute block parameter
Class Method Summary collapse
-
.call(block) ⇒ void
Checks block provided with attribute Block must have up to two arguments - object(s) and context.
Class Method Details
.call(block) ⇒ void
This method returns an undefined value.
Checks block provided with attribute Block must have up to two arguments - object(s) and context.
31 32 33 34 35 36 |
# File 'lib/serega/plugins/metadata/validations/check_block.rb', line 31 def call(block) SeregaValidations::Utils::CheckExtraKeywordArg.call(block, "block") params_count = SeregaUtils::ParamsCount.call(block, max_count: 2) raise SeregaError, block_error if params_count > 2 end |