Module: Rwc::Concerns::Validation
- Defined in:
- lib/rwc/concerns/validation.rb
Overview
Provides validation methods for input classes.
Instance Method Summary collapse
-
#valid? ⇒ Boolean
Checks if the input is valid by running validations.
-
#validate! ⇒ Object
Validates the input.
Instance Method Details
#valid? ⇒ Boolean
Checks if the input is valid by running validations.
10 11 12 13 |
# File 'lib/rwc/concerns/validation.rb', line 10 def valid? validate! errors.empty? end |
#validate! ⇒ Object
Validates the input. Must be implemented by including class.
18 19 20 |
# File 'lib/rwc/concerns/validation.rb', line 18 def validate! raise NotImplementedError end |