Class: Optout::Validator::Regexp

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



528
529
530
531
532
# File 'lib/optout.rb', line 528

def validate!(opt)
  if !opt.empty? && opt.value.to_s !~ setting
    raise OptionInvalid.new(opt.key, "value '#{opt.value}' does not match pattern #{setting}")
  end
end