Module: NxtSchema::Dsl
- Included in:
- NxtSchema
- Defined in:
- lib/nxt_schema/dsl.rb
Constant Summary collapse
Instance Method Summary collapse
- #any_of(name = :roots, **options, &block) ⇒ Object
- #collection(name = :root, type: NxtSchema::Template::Collection::DEFAULT_TYPE, **options, &block) ⇒ Object (also: #nodes)
-
#params(name = :params, type: NxtSchema::Template::Schema::DEFAULT_TYPE, **options, &block) ⇒ Object
schema root with NxtSchema::Types::Params type system.
- #schema(name = :roots, type: NxtSchema::Template::Schema::DEFAULT_TYPE, **options, &block) ⇒ Object
Instance Method Details
#any_of(name = :roots, **options, &block) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/nxt_schema/dsl.rb', line 27 def any_of(name = :roots, **, &block) NxtSchema::Template::AnyOf.new( name: name, parent_node: nil, **DEFAULT_OPTIONS.merge(), &block ) end |
#collection(name = :root, type: NxtSchema::Template::Collection::DEFAULT_TYPE, **options, &block) ⇒ Object Also known as: nodes
5 6 7 8 9 10 11 12 13 |
# File 'lib/nxt_schema/dsl.rb', line 5 def collection(name = :root, type: NxtSchema::Template::Collection::DEFAULT_TYPE, **, &block) NxtSchema::Template::Collection.new( name: name, type: type, parent_node: nil, **DEFAULT_OPTIONS.merge(), &block ) end |
#params(name = :params, type: NxtSchema::Template::Schema::DEFAULT_TYPE, **options, &block) ⇒ Object
schema root with NxtSchema::Types::Params type system
38 39 40 41 42 43 44 45 46 |
# File 'lib/nxt_schema/dsl.rb', line 38 def params(name = :params, type: NxtSchema::Template::Schema::DEFAULT_TYPE, **, &block) NxtSchema::Template::Schema.new( name: name, type: type, parent_node: nil, **.merge(type_system: NxtSchema::Types::Params), &block ) end |
#schema(name = :roots, type: NxtSchema::Template::Schema::DEFAULT_TYPE, **options, &block) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/nxt_schema/dsl.rb', line 17 def schema(name = :roots, type: NxtSchema::Template::Schema::DEFAULT_TYPE, **, &block) NxtSchema::Template::Schema.new( name: name, type: type, parent_node: nil, **DEFAULT_OPTIONS.merge(), &block ) end |