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) ⇒ 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:



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

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

  check_opt_delegate(opts)
  check_usage_with_other_params(opts)
end