Class: Serega::SeregaPlugins::Metadata::MetaAttribute::CheckOptHideEmpty

Inherits:
Object
  • Object
show all
Defined in:
lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb

Class Method Summary collapse

Class Method Details

.call(opts) ⇒ void

This method returns an undefined value.

Checks attribute :after_hide_if option

Parameters:

  • opts (Hash)

    Attribute options

Raises:

  • (SeregaError)

    SeregaError that option has invalid value



18
19
20
21
22
23
24
25
# File 'lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb', line 18

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

  value = opts[:hide_empty]
  return if value == true

  raise SeregaError, "Invalid option :hide_empty => #{value.inspect}. Must be true"
end