Class: Avro::SchemaValidator::Result
- Inherits:
-
Object
- Object
- Avro::SchemaValidator::Result
- Defined in:
- lib/avro/schema_validator.rb
Instance Method Summary collapse
- #<<(error) ⇒ Object
- #add_error(path, message) ⇒ Object
- #errors ⇒ Object
- #failure? ⇒ Boolean
- #to_s ⇒ Object
Instance Method Details
#<<(error) ⇒ Object
36 37 38 |
# File 'lib/avro/schema_validator.rb', line 36 def <<(error) errors << error end |
#add_error(path, message) ⇒ Object
40 41 42 |
# File 'lib/avro/schema_validator.rb', line 40 def add_error(path, ) self << "at #{path} #{}" end |
#errors ⇒ Object
52 53 54 55 |
# File 'lib/avro/schema_validator.rb', line 52 def errors # Use less memory for success results by lazily creating the errors array @errors ||= [] end |
#failure? ⇒ Boolean
44 45 46 |
# File 'lib/avro/schema_validator.rb', line 44 def failure? defined?(@errors) && errors.any? end |
#to_s ⇒ Object
48 49 50 |
# File 'lib/avro/schema_validator.rb', line 48 def to_s failure? ? errors.join("\n") : '' end |