Sha256: 98635512ce70c4e61533a6f7c9a658cbde0e1343ae4134ae1eba7eff2f4c06cd

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 Bytes

Contents

module NxtSchema
  module Node
    class Schema < Node::Base
      include HasSubNodes

      DEFAULT_TYPE = NxtSchema::Types::Strict::Hash

      def initialize(name:, type: DEFAULT_TYPE, parent_node:, **options, &block)
        super
      end

      def optional(name, node_or_type_of_node, **options, &block)
        node(name, node_or_type_of_node, **options.merge(optional: true), &block)
      end

      def omnipresent(name, node_or_type_of_node, **options, &block)
        node(name, node_or_type_of_node, **options.merge(omnipresent: true), &block)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nxt_schema-1.0.0 lib/nxt_schema/node/schema.rb