Sha256: 1f8b0d8fafe1e46e69c272541946ffc73847e05f81bd7eed89bd6d857843ed0f
Contents?: true
Size: 396 Bytes
Versions: 3
Compression:
Stored size: 396 Bytes
Contents
require 'addressable/uri' require 'jschematic/element' module Jschematic module Attributes class Ref include Jschematic::Element def initialize(uri) @uri = Addressable::URI.parse(uri) end def accepts?(instance) schema = Schema.schema_for(@uri) || raise(SchemaNotFoundError.new(@uri)) schema.accepts?(instance) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
jschematic-0.0.9 | lib/jschematic/attributes/ref.rb |
jschematic-0.0.6 | lib/jschematic/attributes/ref.rb |
jschematic-0.0.5 | lib/jschematic/attributes/ref.rb |