Class: Serega::SeregaValidations::Attribute::CheckOptKey

Inherits:
Object
  • Object
show all
Defined in:
lib/serega/validations/attribute/check_opt_key.rb

Overview

Attribute :key option validator

Class Method Summary collapse

Class Method Details

.call(opts, block = nil) ⇒ void

This method returns an undefined value.

Checks attribute :key option

Parameters:

  • opts (Hash)

    Attribute options

Raises:

  • (SeregaError)

    SeregaError that option has invalid value



20
21
22
23
24
25
# File 'lib/serega/validations/attribute/check_opt_key.rb', line 20

def call(opts, block = nil)
  return unless opts.key?(:key)

  check_usage_with_other_params(opts, block)
  Utils::CheckOptIsStringOrSymbol.call(opts, :key)
end