Sha256: d5bbee98062424a021ac009fa1c9920f455451b7ef3aa99c8fe90caf69692080
Contents?: true
Size: 900 Bytes
Versions: 19
Compression:
Stored size: 900 Bytes
Contents
# frozen_string_literal: true require "dry/schema/constants" require "dry/schema/types" module Dry module Schema # A simple wrapper around Dry::Types registry # # This is used internally by specialized processor sub-classes # # @api private class TypeRegistry # @api private attr_reader :types # @api private attr_reader :namespace # @api private def self.new(types = Dry::Types, namespace = :strict) super end # @api private def initialize(types, namespace = :strict) @types = types @namespace = namespace end # @api private def namespaced(ns) self.class.new(types, ns) end # @api private def [](name) key = [namespace, name].compact.join(DOT) types.registered?(key) ? types[key] : types[name.to_s] end end end end
Version data entries
19 entries across 19 versions & 1 rubygems