Module: FlexValidations::Validation Abstract
- Defined in:
- lib/flex_validations/validation.rb
Overview
Instance Method Summary collapse
- #===(value) ⇒ Boolean
- #to_proc ⇒ Proc
- #to_s ⇒ String abstract
- #validate(value) ⇒ FlexValidations::Result abstract
Instance Method Details
#===(value) ⇒ Boolean
37 38 39 |
# File 'lib/flex_validations/validation.rb', line 37 def ===(value) validate(value).success? || super end |
#to_proc ⇒ Proc
45 46 47 |
# File 'lib/flex_validations/validation.rb', line 45 def to_proc proc { |value| validate(value).success? } end |
#to_s ⇒ String
This method is abstract.
Returns description of validation
24 25 26 |
# File 'lib/flex_validations/validation.rb', line 24 def to_s raise 'not implemented' end |
#validate(value) ⇒ FlexValidations::Result
This method is abstract.
Do validation of value
17 18 19 |
# File 'lib/flex_validations/validation.rb', line 17 def validate(value) raise 'not implemented' end |