Class: Vindetta::Validator
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- Vindetta::Validator
- Defined in:
- lib/vindetta/validator.rb
Constant Summary collapse
- LENGTH =
17
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.run(value) ⇒ Object
7 8 9 |
# File 'lib/vindetta/validator.rb', line 7 def self.run(value) Vin.new(value).valid? end |
Instance Method Details
#validate(record) ⇒ Object
11 12 13 14 15 |
# File 'lib/vindetta/validator.rb', line 11 def validate(record) record.errors.add(:value, I18n.t("invalid_length")) if record.value.length != LENGTH # TODO: Check format end |