Class: UseCaseValidations::Validator
- Inherits:
-
Object
- Object
- UseCaseValidations::Validator
- Defined in:
- lib/usecasing_validations/validator.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Validator
constructor
A new instance of Validator.
-
#validate(record) ⇒ Object
Override this method in subclasses with validation logic, adding errors to the records
errors
array where necessary.
Constructor Details
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
6 7 8 |
# File 'lib/usecasing_validations/validator.rb', line 6 def base @base end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/usecasing_validations/validator.rb', line 5 def @options end |
Instance Method Details
#validate(record) ⇒ Object
Override this method in subclasses with validation logic, adding errors to the records errors
array where necessary.
14 15 16 |
# File 'lib/usecasing_validations/validator.rb', line 14 def validate(record) raise NotImplementedError, "Subclasses must implement a validate(record) method." end |