Method: Jschematic::Context.schema_for

Defined in:
lib/jschematic/context.rb

.schema_for(ref) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/jschematic/context.rb', line 5

def self.schema_for(ref)
  if ref.relative?
    rel = ref.omit(:scheme, :host, :port)
    if match = schemas.find{ |ref, _| rel == ref.omit(:scheme, :host, :port) }
      match[-1]
    end
  else
    schemas[ref]
  end
end