Class: Validatable::ValidatesEach
- Inherits:
-
ValidationBase
- Object
- ValidationBase
- Validatable::ValidatesEach
- Defined in:
- lib/validatable/validations/validates_each.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#logic ⇒ Object
Returns the value of attribute logic.
Attributes inherited from ValidationBase
#after_validate, #allow_blank, #allow_nil, #attribute, #if, #klass
Instance Method Summary collapse
Methods inherited from ValidationBase
Constructor Details
This class inherits a constructor from Validatable::ValidationBase
Instance Attribute Details
#logic ⇒ Object
Returns the value of attribute logic.
3 4 5 |
# File 'lib/validatable/validations/validates_each.rb', line 3 def logic @logic end |
Instance Method Details
#message(instance) ⇒ Object
10 11 12 |
# File 'lib/validatable/validations/validates_each.rb', line 10 def (instance) super || "is invalid" end |
#valid?(instance) ⇒ Boolean
5 6 7 8 |
# File 'lib/validatable/validations/validates_each.rb', line 5 def valid?(instance) instance.instance_eval(&logic) true # return true so no error is added. should look in the future at doing this different. end |