Class: Serega::SeregaValidations::Attribute::CheckOptMany

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

Overview

Attribute :many option validator

Class Method Summary collapse

Class Method Details

.call(opts, block = nil) ⇒ void

This method returns an undefined value.

Checks attribute :many option

Parameters:

  • opts (Hash)

    Attribute options

  • block (nil, Proc) (defaults to: nil)

    Attribute block

Raises:

  • (SeregaError)

    SeregaError that option has invalid value



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

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

  check_many_option_makes_sence(opts, block)
  Utils::CheckOptIsBool.call(opts, :many)
end