Class: Serega::SeregaPlugins::If::CheckOptIf

Inherits:
Object
  • Object
show all
Defined in:
lib/serega/plugins/if/validations/check_opt_if.rb

Overview

Validator for attribute :if option

Class Method Summary collapse

Class Method Details

.call(opts) ⇒ void

This method returns an undefined value.

Checks attribute :if option that must be [nil, Symbol, Proc, #call]

Parameters:

  • opts (Hash)

    Attribute options

Raises:



20
21
22
23
24
# File 'lib/serega/plugins/if/validations/check_opt_if.rb', line 20

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

  check_type(opts[:if])
end