Class: Optout::Validator::Array
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Instance Method Details
#validate!(opt) ⇒ Object
543 544 545 546 547 548 549 550 551 552 |
# File 'lib/optout.rb', line 543 def validate!(opt) return if opt.empty? values = [opt.value].flatten values.each do |e| if !setting.include?(e) raise OptionInvalid.new(opt.key, "value '#{e}' must be one of (#{setting.join(", ")})") end end end |