Class: JSONSkooma::Keywords::Core::Id
- Defined in:
- lib/json_skooma/keywords/core/id.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(parent_schema, value) ⇒ Id
constructor
A new instance of Id.
Methods inherited from Base
#each_schema, #evaluate, inherited, #instance_types, #key, #resolve, set_defaults, #static, value_schema=
Constructor Details
#initialize(parent_schema, value) ⇒ Id
Returns a new instance of Id.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/json_skooma/keywords/core/id.rb', line 10 def initialize(parent_schema, value) super uri = URI.parse(value) if uri.relative? base_uri = parent_schema.base_uri if base_uri uri = base_uri + uri else raise "No base URI against which to resolve the `$id` value `#{value}`" end end parent_schema.uri = uri end |