Class: Avro::SchemaValidator::Result
- Inherits:
-
Object
- Object
- Avro::SchemaValidator::Result
- Defined in:
- lib/avro-patches/schema_validator/schema_validator.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #<<(error) ⇒ Object
- #add_error(path, message) ⇒ Object
- #failure? ⇒ Boolean
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
29 30 31 |
# File 'lib/avro-patches/schema_validator/schema_validator.rb', line 29 def initialize @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
27 28 29 |
# File 'lib/avro-patches/schema_validator/schema_validator.rb', line 27 def errors @errors end |
Instance Method Details
#<<(error) ⇒ Object
33 34 35 |
# File 'lib/avro-patches/schema_validator/schema_validator.rb', line 33 def <<(error) @errors << error end |
#add_error(path, message) ⇒ Object
37 38 39 |
# File 'lib/avro-patches/schema_validator/schema_validator.rb', line 37 def add_error(path, ) self << "at #{path} #{}" end |
#failure? ⇒ Boolean
41 42 43 |
# File 'lib/avro-patches/schema_validator/schema_validator.rb', line 41 def failure? @errors.any? end |
#to_s ⇒ Object
45 46 47 |
# File 'lib/avro-patches/schema_validator/schema_validator.rb', line 45 def to_s errors.join("\n") end |