Class: Serega::SeregaPlugins::HideNil::CheckOptHideNil
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::HideNil::CheckOptHideNil
- Defined in:
- lib/serega/plugins/hide_nil/hide_nil.rb
Overview
Validator class for :hide_nil attribute option
Class Method Summary collapse
-
.call(opts) ⇒ void
Checks attribute :hide_nil option.
Class Method Details
.call(opts) ⇒ void
This method returns an undefined value.
Checks attribute :hide_nil option
80 81 82 83 84 85 86 87 |
# File 'lib/serega/plugins/hide_nil/hide_nil.rb', line 80 def self.call(opts) return unless opts.key?(:hide_nil) value = opts[:hide_nil] return if (value == true) || (value == false) raise SeregaError, "Invalid option :hide_nil => #{value.inspect}. Must have a boolean value" end |