Class: Serega::SeregaPlugins::Batch::CheckBatchOptKey

Inherits:
Object
  • Object
show all
Defined in:
lib/serega/plugins/batch/lib/validations/check_batch_opt_key.rb

Class Method Summary collapse

Class Method Details

.call(key) ⇒ Object

Raises:



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/serega/plugins/batch/lib/validations/check_batch_opt_key.rb', line 8

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