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 |
# File 'lib/serega/plugins/metadata/validations/check_block.rb', line 31 def call(block) signature = SeregaUtils::MethodSignature.call(block, pos_limit: 2, keyword_args: []) raise SeregaError, block_error unless %w[0 1 2].include?(signature) end |