Class: Mixture::Validate::Exclusion
- Defined in:
- lib/mixture/validate/exclusion.rb
Overview
Checks to make sure that the value isn't in the given set. This
uses the #includes?
method on the @options
.
Instance Method Summary collapse
-
#validate(record, attribute, value) ⇒ void
Performs the validation.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Mixture::Validate::Base
Instance Method Details
#validate(record, attribute, value) ⇒ void
This method returns an undefined value.
Performs the validation.
14 15 16 17 18 |
# File 'lib/mixture/validate/exclusion.rb', line 14 def validate(record, attribute, value) super error("Value is in the given set") if @options[:in].include?(value) end |