Exception: JSONSkooma::UnexpectedSchemaClassError
- Inherits:
-
RegistryError
- Object
- StandardError
- Error
- RegistryError
- JSONSkooma::UnexpectedSchemaClassError
- Defined in:
- lib/json_skooma/registry.rb
Overview
Raised when a ref resolves to an object that is not the class the caller expected. Extension points (e.g. typed OpenAPI refs) can rescue this and load the subtree as the right class without matching on error message text.
Instance Attribute Summary collapse
-
#expected_class ⇒ Object
readonly
Returns the value of attribute expected_class.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri, expected_class) ⇒ UnexpectedSchemaClassError
constructor
A new instance of UnexpectedSchemaClassError.
Constructor Details
#initialize(uri, expected_class) ⇒ UnexpectedSchemaClassError
Returns a new instance of UnexpectedSchemaClassError.
12 13 14 15 16 |
# File 'lib/json_skooma/registry.rb', line 12 def initialize(uri, expected_class) @uri = uri @expected_class = expected_class super("The object referenced by #{uri} is not #{expected_class}") end |
Instance Attribute Details
#expected_class ⇒ Object (readonly)
Returns the value of attribute expected_class.
10 11 12 |
# File 'lib/json_skooma/registry.rb', line 10 def expected_class @expected_class end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
10 11 12 |
# File 'lib/json_skooma/registry.rb', line 10 def uri @uri end |