Class: Veto::AttributeCheck
- Defined in:
- lib/veto/checks/attribute_check.rb
Direct Known Subclasses
ExactLengthCheck, FormatCheck, GreaterThanCheck, GreaterThanOrEqualToCheck, InclusionCheck, IntegerCheck, LengthRangeCheck, LessThanCheck, LessThanOrEqualToCheck, MaxLengthCheck, MinLengthCheck, NotNullCheck, NumericCheck, PresenceCheck
Instance Method Summary collapse
- #call(cco) ⇒ Object
-
#initialize(attribute_name, options = {}) ⇒ AttributeCheck
constructor
A new instance of AttributeCheck.
Constructor Details
#initialize(attribute_name, options = {}) ⇒ AttributeCheck
Returns a new instance of AttributeCheck.
3 4 5 6 |
# File 'lib/veto/checks/attribute_check.rb', line 3 def initialize(attribute_name, ={}) @attribute_name = attribute_name @options = end |
Instance Method Details
#call(cco) ⇒ Object
8 9 10 11 |
# File 'lib/veto/checks/attribute_check.rb', line 8 def call(cco) value = cco.entity.public_send(@attribute_name) check(@attribute_name, value, cco.errors, @options) end |