class Dry::Schema::TypeRegistry
A simple wrapper around Dry::Types registry
This is used internally by specialized processor sub-classes
@api private
Attributes
namespace[R]
@api private
types[R]
@api private
Public Class Methods
new(types = Dry::Types, namespace = :strict)
click to toggle source
@api private
Calls superclass method
# File lib/dry/schema/type_registry.rb, line 21 def self.new(types = Dry::Types, namespace = :strict) super end
new(types, namespace = :strict)
click to toggle source
@api private
# File lib/dry/schema/type_registry.rb, line 26 def initialize(types, namespace = :strict) @types = types @namespace = namespace end
Public Instance Methods
[](name)
click to toggle source
@api private
# File lib/dry/schema/type_registry.rb, line 37 def [](name) key = [namespace, name].compact.join(DOT) type = types.registered?(key) ? types[key] : types[name.to_s] type end
namespaced(ns)
click to toggle source
@api private
# File lib/dry/schema/type_registry.rb, line 32 def namespaced(ns) self.class.new(types, ns) end