Module: ObjectValidator::Validator::InstanceMethods
- Defined in:
- lib/object_validator/validator.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
9 10 11 |
# File 'lib/object_validator/validator.rb', line 9 def errors @errors end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
9 10 11 |
# File 'lib/object_validator/validator.rb', line 9 def object @object end |
Instance Method Details
#initialize(object) ⇒ Object
11 12 13 14 |
# File 'lib/object_validator/validator.rb', line 11 def initialize(object) @object = object @errors = Errors.new end |
#valid? ⇒ Boolean
16 17 18 19 |
# File 'lib/object_validator/validator.rb', line 16 def valid? self.class.checks.each { |args| call_checks(*args) } @errors.all.empty? end |