Class: NxtSchema::Node::AnyOf
- Includes:
- HasSubNodes
- Defined in:
- lib/nxt_schema/node/any_of.rb
Instance Attribute Summary
Attributes inherited from Base
#additional_keys_strategy, #configuration, #context, #key_transformer, #maybe_evaluators, #meta, #name, #on_evaluators, #options, #parent_node, #path, #root_node, #type, #type_system, #validations
Instance Method Summary collapse
- #collection(name = sub_nodes.count, type = NxtSchema::Node::Collection::DEFAULT_TYPE, **options, &block) ⇒ Object
-
#initialize(name:, type: nil, parent_node:, **options, &block) ⇒ AnyOf
constructor
A new instance of AnyOf.
- #maybe(*args) ⇒ Object
- #node(name = sub_nodes.count, node_or_type_of_node = nil, **options, &block) ⇒ Object
-
#on(*args) ⇒ Object
TODO: Maybe overwrite sub node methods to not have to provide a name here and use node count instead.
- #schema(name = sub_nodes.count, type = NxtSchema::Node::Schema::DEFAULT_TYPE, **options, &block) ⇒ Object
Methods included from HasSubNodes
#[], #add_sub_node, #any_of, #sub_nodes
Methods inherited from Base
#apply, #apply!, #build_application, #default, #omnipresent?, #optional?, #root_node?, #validate, #validate_with
Constructor Details
#initialize(name:, type: nil, parent_node:, **options, &block) ⇒ AnyOf
Returns a new instance of AnyOf.
6 7 8 |
# File 'lib/nxt_schema/node/any_of.rb', line 6 def initialize(name:, type: nil, parent_node:, **, &block) super end |
Instance Method Details
#collection(name = sub_nodes.count, type = NxtSchema::Node::Collection::DEFAULT_TYPE, **options, &block) ⇒ Object
10 11 12 |
# File 'lib/nxt_schema/node/any_of.rb', line 10 def collection(name = sub_nodes.count, type = NxtSchema::Node::Collection::DEFAULT_TYPE, **, &block) super end |
#maybe(*args) ⇒ Object
28 29 30 |
# File 'lib/nxt_schema/node/any_of.rb', line 28 def maybe(*args) raise NotImplementedError end |
#node(name = sub_nodes.count, node_or_type_of_node = nil, **options, &block) ⇒ Object
18 19 20 |
# File 'lib/nxt_schema/node/any_of.rb', line 18 def node(name = sub_nodes.count, node_or_type_of_node = nil, **, &block) super end |
#on(*args) ⇒ Object
TODO: Maybe overwrite sub node methods to not have to provide a name here and use node count instead
24 25 26 |
# File 'lib/nxt_schema/node/any_of.rb', line 24 def on(*args) raise NotImplementedError end |
#schema(name = sub_nodes.count, type = NxtSchema::Node::Schema::DEFAULT_TYPE, **options, &block) ⇒ Object
14 15 16 |
# File 'lib/nxt_schema/node/any_of.rb', line 14 def schema(name = sub_nodes.count, type = NxtSchema::Node::Schema::DEFAULT_TYPE, **, &block) super end |