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 29 30 |
# 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) if key.is_a?(Proc) check_block(key) else check_callable(key) end end |