Module: PairKit::JsonSchema::Dsl::CorePartialDsl
- Included in:
- CommonPartialDsl
- Defined in:
- lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb
Instance Method Summary collapse
- #anchor(anchor) ⇒ Object
- #comment(comment) ⇒ Object
- #define(name, &block) ⇒ Object (also: #dfn)
- #dynamic_anchor(anchor) ⇒ Object
- #dynamic_ref(ref) ⇒ Object
- #id(id) ⇒ Object
- #ref(ref) ⇒ Object
- #schema(schema) ⇒ Object
- #vocabulary(vocab) ⇒ Object
Instance Method Details
#anchor(anchor) ⇒ Object
29 30 31 |
# File 'lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb', line 29 def anchor(anchor) @subject['$anchor'] = anchor end |
#comment(comment) ⇒ Object
19 20 21 |
# File 'lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb', line 19 def comment(comment) @subject['$comment'] = comment end |
#define(name, &block) ⇒ Object Also known as: dfn
23 24 25 |
# File 'lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb', line 23 def define(name, &block) @dsl.(@subject['$defs', {}][name, {}], &block) end |
#dynamic_anchor(anchor) ⇒ Object
33 34 35 |
# File 'lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb', line 33 def dynamic_anchor(anchor) @subject['$dynamicAnchor'] = anchor end |
#dynamic_ref(ref) ⇒ Object
37 38 39 |
# File 'lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb', line 37 def dynamic_ref(ref) @subject['$dynamicRef'] = ref end |
#id(id) ⇒ Object
11 12 13 |
# File 'lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb', line 11 def id(id) @subject['$id'] = id end |
#ref(ref) ⇒ Object
15 16 17 |
# File 'lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb', line 15 def ref(ref) @subject['$ref'] = ref end |
#schema(schema) ⇒ Object
7 8 9 |
# File 'lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb', line 7 def schema(schema) @subject['$schema'] = schema end |
#vocabulary(vocab) ⇒ Object
41 42 43 |
# File 'lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb', line 41 def vocabulary(vocab) @subject['$vocabulary', {}][vocab] = true end |