Class: NxtSchema::Node::AnyOf

Inherits:
Base
  • Object
show all
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

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:, **options, &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, **options, &block)
  super
end

#maybe(*args) ⇒ Object

Raises:

  • (NotImplementedError)


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, **options, &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

Raises:

  • (NotImplementedError)


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, **options, &block)
  super
end