Class: NxtSchema::Template::AnyOf
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::Template::Collection::DEFAULT_TYPE, **options, &block) ⇒ Object
-
#initialize(name:, type: nil, parent_node:, **options, &block) ⇒ AnyOf
constructor
-
#maybe(*args) ⇒ Object
-
#node(name = sub_nodes.count, node_or_type_of_node = nil, **options, &block) ⇒ Object
-
#on(*args) ⇒ Object
-
#schema(name = sub_nodes.count, type = NxtSchema::Template::Schema::DEFAULT_TYPE, **options, &block) ⇒ Object
#[], #add_sub_node, #any_of, #ensure_sub_nodes_present, #sub_nodes
Methods inherited from Base
#apply, #apply!, #build_node, #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
9
|
# File 'lib/nxt_schema/template/any_of.rb', line 6
def initialize(name:, type: nil, parent_node:, **options, &block)
super
ensure_sub_nodes_present
end
|
Instance Method Details
#collection(name = sub_nodes.count, type = NxtSchema::Template::Collection::DEFAULT_TYPE, **options, &block) ⇒ Object
#maybe(*args) ⇒ Object
27
28
29
|
# File 'lib/nxt_schema/template/any_of.rb', line 27
def maybe(*args)
raise NotImplementedError
end
|
#node(name = sub_nodes.count, node_or_type_of_node = nil, **options, &block) ⇒ Object
19
20
21
|
# File 'lib/nxt_schema/template/any_of.rb', line 19
def node(name = sub_nodes.count, node_or_type_of_node = nil, **options, &block)
super
end
|
#on(*args) ⇒ Object
23
24
25
|
# File 'lib/nxt_schema/template/any_of.rb', line 23
def on(*args)
raise NotImplementedError
end
|
#schema(name = sub_nodes.count, type = NxtSchema::Template::Schema::DEFAULT_TYPE, **options, &block) ⇒ Object