Class: Mixture::Validate::Base Abstract
- Inherits:
-
Object
- Object
- Mixture::Validate::Base
- Defined in:
- lib/mixture/validate/base.rb
Overview
This class is abstract.
A base for validations. All validators should inherit this class.
Class Method Summary collapse
-
.register_as(name) ⇒ void
Registers this validator as the given name.
Instance Method Summary collapse
-
#initialize(options) ⇒ Base
constructor
Initialize the validator.
-
#validate(record, attribute, value) ⇒ void
abstract
Performs the validation.
Constructor Details
#initialize(options) ⇒ Base
Initialize the validator.
23 24 25 |
# File 'lib/mixture/validate/base.rb', line 23 def initialize() @options = end |
Class Method Details
Instance Method Details
#validate(record, attribute, value) ⇒ void
This method is abstract.
This method returns an undefined value.
Performs the validation.
35 36 37 38 39 |
# File 'lib/mixture/validate/base.rb', line 35 def validate(record, attribute, value) @record = record @attribute = attribute @value = value end |