Class: Compel::Validation::Is
- Defined in:
- lib/compel/validation/conditions/is.rb
Instance Attribute Summary
Attributes inherited from Condition
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
#option_value ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/compel/validation/conditions/is.rb', line 6 def option_value if value_type == Coercion::Hash return @option_value.to_hash end @option_value end |
#validate_value ⇒ Object
14 15 16 17 18 |
# File 'lib/compel/validation/conditions/is.rb', line 14 def validate_value unless valid? "must be #{option_value}" end end |