Class: Serega::SeregaPlugins::Batch::CheckBatchOptKey
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::Batch::CheckBatchOptKey
- Defined in:
- lib/serega/plugins/batch/lib/validations/check_batch_opt_key.rb
Overview
Validator for option :key in attribute :batch option
Class Method Summary collapse
-
.call(key) ⇒ void
Checks option :key of attribute :batch option.
Class Method Details
.call(key) ⇒ void
This method returns an undefined value.
Checks option :key of attribute :batch option
20 21 22 23 24 25 26 27 28 |
# File 'lib/serega/plugins/batch/lib/validations/check_batch_opt_key.rb', line 20 def call(key) return if key.is_a?(Symbol) raise SeregaError, must_be_callable unless key.respond_to?(:call) SeregaValidations::Utils::CheckExtraKeywordArg.call(key, "batch option :key") params_count = SeregaUtils::ParamsCount.call(key, max_count: 2) raise SeregaError, params_count_error if params_count > 2 end |