Class: Serega::SeregaPlugins::Preloads::CheckOptPreload

Inherits:
Object
  • Object
show all
Defined in:
lib/serega/plugins/preloads/validations/check_opt_preload.rb

Overview

Validator for attribute :preload option

Class Method Summary collapse

Class Method Details

.call(opts) ⇒ void

This method returns an undefined value.

Checks :preload option

Parameters:

  • opts (Hash)

    Attribute options

Raises:



19
20
21
22
23
# File 'lib/serega/plugins/preloads/validations/check_opt_preload.rb', line 19

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

  raise SeregaError, "Option :preload can not be used together with option :const" if opts.key?(:const)
end