Class: Avro::SchemaValidator::Result
- Inherits:
-
Object
- Object
- Avro::SchemaValidator::Result
- Defined in:
- lib/avro/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.
28 29 30 |
# File 'lib/avro/schema_validator.rb', line 28 def initialize @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
26 27 28 |
# File 'lib/avro/schema_validator.rb', line 26 def errors @errors end |
Instance Method Details
#<<(error) ⇒ Object
32 33 34 |
# File 'lib/avro/schema_validator.rb', line 32 def <<(error) @errors << error end |
#add_error(path, message) ⇒ Object
36 37 38 |
# File 'lib/avro/schema_validator.rb', line 36 def add_error(path, ) self << "at #{path} #{}" end |
#failure? ⇒ Boolean
40 41 42 |
# File 'lib/avro/schema_validator.rb', line 40 def failure? @errors.any? end |
#to_s ⇒ Object
44 45 46 |
# File 'lib/avro/schema_validator.rb', line 44 def to_s errors.join("\n") end |