Module: Serega::Attribute::CheckOpts::ClassMethods

Included in:
Serega::Attribute::CheckOpts
Defined in:
lib/serega/validations/attribute/check_opts.rb

Instance Method Summary collapse

Instance Method Details

#call(opts, attribute_keys) ⇒ void

This method returns an undefined value.

Validates attribute options Checks used options are allowed and then checks options values.

Parameters:

  • opts (Hash)

    Attribute options

  • attribute_keys (Array<Symbol>)

    Allowed options keys

Raises:

  • (Error)

    when attribute has invalid options



18
19
20
21
# File 'lib/serega/validations/attribute/check_opts.rb', line 18

def call(opts, attribute_keys)
  CheckAllowedKeys.call(opts, attribute_keys)
  check_each_opt(opts)
end