Class: JsonSchemaRails::Loaders::HyperSchema

Inherits:
Base
  • Object
show all
Defined in:
lib/json_schema_rails/loaders/hyper_schema.rb

Defined Under Namespace

Classes: SchemaIndex

Instance Attribute Summary collapse

Attributes inherited from Base

#cache

Instance Method Summary collapse

Methods inherited from Base

#cache?, #clear, #load_schema

Constructor Details

#initialize(path, options = {}) ⇒ HyperSchema

Returns a new instance of HyperSchema.



6
7
8
9
# File 'lib/json_schema_rails/loaders/hyper_schema.rb', line 6

def initialize(path, options = {})
  @path = path
  super(options)
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/json_schema_rails/loaders/hyper_schema.rb', line 4

def path
  @path
end

Instance Method Details

#load_schema!(schema_path) ⇒ Object



11
12
13
14
15
# File 'lib/json_schema_rails/loaders/hyper_schema.rb', line 11

def load_schema!(schema_path)
  with_cache(schema_path) do
    schema_index.find(schema_path) or raise SchemaNotFound
  end
end