Class: NxtSchema::Template::AnyOf

Inherits:
Base
  • Object
show all
Includes:
HasSubNodes
Defined in:
lib/nxt_schema/template/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

Methods included from HasSubNodes

#[], #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



11
12
13
# File 'lib/nxt_schema/template/any_of.rb', line 11

def collection(name = sub_nodes.count, type = NxtSchema::Template::Collection::DEFAULT_TYPE, **options, &block)
  super
end

#maybe(*args) ⇒ Object

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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



15
16
17
# File 'lib/nxt_schema/template/any_of.rb', line 15

def schema(name = sub_nodes.count, type = NxtSchema::Template::Schema::DEFAULT_TYPE, **options, &block)
  super
end