Class: Dry::Mutations::Transactions::StepAdapters::Move
- Inherits:
-
Object
- Object
- Dry::Mutations::Transactions::StepAdapters::Move
show all
- Defined in:
- lib/dry/mutations/transactions/step_adapters.rb
Overview
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.adapters ⇒ Object
23
24
25
|
# File 'lib/dry/mutations/transactions/step_adapters.rb', line 23
def self.adapters
@adapters ||= Utils.Hash
end
|
.inherited(sub) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/dry/mutations/transactions/step_adapters.rb', line 9
def self.inherited(sub)
name = Utils.Snake(sub, short: true, symbolize: true)
StepAdapters.register name, sub.new
adapters[name] = sub
sub.prepend(Module.new do
def call(step, *args, input)
outcome = super
ensure
::Dry::Mutations::Utils.extend_outcome outcome.value, "#{step.step_name}::#{step.operation_name}" if outcome
end
end)
end
|
Instance Method Details
#call(step, *args, input) ⇒ Object
27
28
29
|
# File 'lib/dry/mutations/transactions/step_adapters.rb', line 27
def call(step, *args, input)
step.operation.(input, *args, &step.block)
end
|