Class: Compel::Validation::In

Inherits:
Condition show all
Defined in:
lib/compel/validation/conditions/in.rb

Direct Known Subclasses

Range

Instance Attribute Summary

Attributes inherited from Condition

#option_value, #options, #value, #value_type

Instance Method Summary collapse

Methods inherited from Condition

#initialize, validate, #validate

Constructor Details

This class inherits a constructor from Compel::Validation::Condition

Instance Method Details

#validate_valueObject



6
7
8
9
10
# File 'lib/compel/validation/conditions/in.rb', line 6

def validate_value
  unless valid?
    "must be within #{option_value}"
  end
end