Class: ObjectValidator::Checks::Base
- Inherits:
-
Object
- Object
- ObjectValidator::Checks::Base
- Defined in:
- lib/object_validator/validator.rb
Direct Known Subclasses
GreaterThan, Keys, Presence, Type, With
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object ⇒ Object
Returns the value of attribute object.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(object, errors, name, value) ⇒ Base
constructor
A new instance of Base.
- #method ⇒ Object
Constructor Details
#initialize(object, errors, name, value) ⇒ Base
Returns a new instance of Base.
54 55 56 57 58 59 |
# File 'lib/object_validator/validator.rb', line 54 def initialize(object, errors, name, value) @object = object @errors = errors @name = name @value = value end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
52 53 54 |
# File 'lib/object_validator/validator.rb', line 52 def errors @errors end |
#name ⇒ Object
Returns the value of attribute name.
52 53 54 |
# File 'lib/object_validator/validator.rb', line 52 def name @name end |
#object ⇒ Object
Returns the value of attribute object.
52 53 54 |
# File 'lib/object_validator/validator.rb', line 52 def object @object end |
#value ⇒ Object
Returns the value of attribute value.
52 53 54 |
# File 'lib/object_validator/validator.rb', line 52 def value @value end |
Instance Method Details
#method ⇒ Object
61 62 63 |
# File 'lib/object_validator/validator.rb', line 61 def method @method ||= @object.send(@name) end |