Class: JSchema::SchemaRef
- Inherits:
-
Delegator
- Object
- Delegator
- JSchema::SchemaRef
- Defined in:
- lib/jschema/schema_ref.rb
Overview
Schema reference is lazy evaluated.
Instance Method Summary collapse
- #__getobj__ ⇒ Object
-
#initialize(uri, parent) ⇒ SchemaRef
constructor
A new instance of SchemaRef.
Constructor Details
#initialize(uri, parent) ⇒ SchemaRef
Returns a new instance of SchemaRef.
4 5 6 7 |
# File 'lib/jschema/schema_ref.rb', line 4 def initialize(uri, parent) @uri = uri @parent = parent end |
Instance Method Details
#__getobj__ ⇒ Object
9 10 11 12 13 14 |
# File 'lib/jschema/schema_ref.rb', line 9 def __getobj__ @schema ||= begin JSONReference.dereference(@uri, @parent) || Kernel.fail(InvalidSchema, "Failed to dereference schema: #{@uri}") end end |