Module: Dry::Schema::ProcessorDecorator

Defined in:
lib/dry/schema/processor_decorator.rb

Overview

Include the processor as Result option so we can deserialize later.

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dry/schema/processor_decorator.rb', line 10

def self.included(base)
  base.class_eval do
    # Add the processor to the result so we can deserialize it
    # later
    def call(input)
      Result.new(input.dup, message_compiler: message_compiler, processor: self) do |result|
        steps.call(result)
      end
    end
  end
end