Class: DataMapper::Validate::NumericValidator
- Inherits:
-
Object
- Object
- DataMapper::Validate::NumericValidator
- Defined in:
- lib/ixtlan/monkey_patches.rb
Instance Method Summary collapse
Instance Method Details
#validate_with_comparison(value, cmp, expected, error_message_name, errors, negated = false) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/ixtlan/monkey_patches.rb', line 25 def validate_with_comparison(value, cmp, expected, , errors, negated = false) return if expected.nil? if cmp == :=~ return value =~ expected end comparison = value.send(cmp, expected) return if negated ? !comparison : comparison errors << ValidationErrors.(, field_name, expected) end |