Class: ValidationUnexpected
- Inherits:
-
ValidationFailure
- Object
- ValidationFailure
- ValidationUnexpected
- Defined in:
- lib/json_patterns.rb
Constant Summary
Constants included from Inspectable
Instance Attribute Summary collapse
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#found ⇒ Object
readonly
Returns the value of attribute found.
Attributes inherited from ValidationFailure
Instance Method Summary collapse
Methods inherited from ValidationFailure
Methods included from HashInitialized
Methods included from DeepEquality
Methods included from Inspectable
Instance Attribute Details
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
228 229 230 |
# File 'lib/json_patterns.rb', line 228 def expected @expected end |
#found ⇒ Object (readonly)
Returns the value of attribute found.
228 229 230 |
# File 'lib/json_patterns.rb', line 228 def found @found end |
Instance Method Details
#to_s ⇒ Object
230 231 232 233 234 235 |
# File 'lib/json_patterns.rb', line 230 def to_s expected = @expected.is_a?(Set) ? (@expected.size == 1 ? @expected.to_a[0] : "one of: " + @expected.to_a.join(', ')) : @expected return "at #{path_to_s}; found #{@found}; expected #{expected}" end |