Class: Dry::Schema::TypeContainer

Inherits:
Object
  • Object
show all
Includes:
Core::Container::Mixin
Defined in:
lib/dry/schema/type_container.rb

Overview

A class to build containers for custom types, which can be used in schemas

Examples:

MyTypeContainer = Dry::Schema::TypeContainer.new
MyTypeContainer.register('params.fancy_string', Types::FancyString)

Instance Method Summary collapse

Constructor Details

#initialize(types_container = Dry::Types.container) ⇒ TypeContainer

Returns a new instance of TypeContainer.



18
19
20
21
22
# File 'lib/dry/schema/type_container.rb', line 18

def initialize(types_container = Dry::Types.container)
  super()

  merge(types_container)
end