Class: Optout::Validator::Boolean

Inherits:
Base
  • Object
show all
Defined in:
lib/optout.rb

Instance Attribute Summary

Attributes inherited from Base

#setting

Instance Method Summary collapse

Instance Method Details

#validate!(opt) ⇒ Object



572
573
574
575
576
577
# File 'lib/optout.rb', line 572

def validate!(opt)
  if !(opt.value == true || opt.value == false || opt.value.nil?)
    # TODO: Better message
    raise OptionInvalid.new(opt.key, "does not accept an argument")
  end
end