Class: Assent::Validate
- Inherits:
-
Object
- Object
- Assent::Validate
- Includes:
- Options
- Defined in:
- lib/assent/validations/validator.rb
Instance Method Summary collapse
-
#initialize(field, value, rules, errors) ⇒ Validate
constructor
A new instance of Validate.
-
#validate ⇒ Object
Validate method that checks all the validations for a single field.
Methods included from Options
Constructor Details
#initialize(field, value, rules, errors) ⇒ Validate
Returns a new instance of Validate.
8 9 10 11 12 13 |
# File 'lib/assent/validations/validator.rb', line 8 def initialize(field, value, rules, errors) @field = field @value = value @rules = rules @errors = errors end |
Instance Method Details
#validate ⇒ Object
Validate method that checks all the validations for a single field
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/assent/validations/validator.rb', line 15 def validate required accepted return if blank? date ip @errors end |