Method: Dry::Types::Hash#with_type_transform
- Defined in:
- lib/dry/types/hash.rb
permalink #with_type_transform(proc = nil, &block) ⇒ Hash
Injects a type transformation function for building schemas
67 68 69 70 71 72 73 74 |
# File 'lib/dry/types/hash.rb', line 67 def with_type_transform(proc = nil, &block) fn = proc || block raise ::ArgumentError, "a block or callable argument is required" if fn.nil? handle = ::Dry::Types::FnContainer.register(fn) with(type_transform_fn: handle) end |