Class: Serega::SeregaValidations::Attribute::CheckOptMethod

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

Overview

Attribute :method option validator

Class Method Summary collapse

Class Method Details

.call(opts) ⇒ void

This method returns an undefined value.

Checks attribute :method option

Parameters:

  • opts (Hash)

    Attribute options

Raises:

  • (SeregaError)

    SeregaError that option has invalid value



23
24
25
26
27
28
# File 'lib/serega/validations/attribute/check_opt_method.rb', line 23

def call(opts)
  return unless opts.key?(:method)

  check_usage_with_other_params(opts)
  Utils::CheckOptIsStringOrSymbol.call(opts, :method)
end