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



556
557
558
559
560
# File 'lib/optout.rb', line 556

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