Class: Serega::SeregaValidations::Attribute::CheckOptDelegate

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

Overview

Attribute :delegate option validator

Class Method Summary collapse

Class Method Details

.call(opts, block = nil) ⇒ void

This method returns an undefined value.

Checks attribute :delegate option It must have :to option and can have :optional allow_nil option

Parameters:

  • opts (Hash)

    Attribute options

Raises:



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

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

  check_opt_delegate(opts)
  check_usage_with_other_params(opts, block)
end