class NxtSchema::Template::AnyOf

Public Class Methods

new(name:, type: nil, parent_node:, **options, &block) click to toggle source
Calls superclass method
# 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

Public Instance Methods

collection(name = sub_nodes.count, type = NxtSchema::Template::Collection::DEFAULT_TYPE, **options, &block) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
Calls superclass method NxtSchema::Template::HasSubNodes#node
# 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) click to toggle source
# 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) click to toggle source
Calls superclass method NxtSchema::Template::HasSubNodes#schema
# 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

Private Instance Methods

resolve_omnipresent_option() click to toggle source
# File lib/nxt_schema/template/any_of.rb, line 43
def resolve_omnipresent_option
  return unless options.key?(:omnipresent)

  raise InvalidOptions, "The omnipresent option is not available for nodes of type #{self.class.name}"
end
resolve_optional_option() click to toggle source
# File lib/nxt_schema/template/any_of.rb, line 37
def resolve_optional_option
  return unless options.key?(:optional)

  raise InvalidOptions, "The optional option is not available for nodes of type #{self.class.name}"
end
resolve_type(name_or_type) click to toggle source
# File lib/nxt_schema/template/any_of.rb, line 33
def resolve_type(name_or_type)
  nil
end