Class: Lotus::Validations::Attribute Private
- Inherits:
-
Object
- Object
- Lotus::Validations::Attribute
- Defined in:
- lib/lotus/validations/attribute.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A validable attribute
Constant Summary collapse
- CONFIRMATION_TEMPLATE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Attribute naming convention for “confirmation” validation
'%{name}_confirmation'.freeze
Instance Attribute Summary collapse
- #value ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(attributes, name, value, validations, errors) ⇒ Attribute
constructor
private
Instantiate an attribute.
- #validate ⇒ Object private
Constructor Details
#initialize(attributes, name, value, validations, errors) ⇒ Attribute
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instantiate an attribute
37 38 39 40 41 42 43 |
# File 'lib/lotus/validations/attribute.rb', line 37 def initialize(attributes, name, value, validations, errors) @attributes = attributes @name = name @value = value @validations = validations @errors = errors end |
Instance Attribute Details
#value ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
65 66 67 |
# File 'lib/lotus/validations/attribute.rb', line 65 def value @value end |
Instance Method Details
#validate ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/lotus/validations/attribute.rb', line 47 def validate presence acceptance return if skip? format inclusion exclusion size confirmation nested @errors end |