class Dry::Transaction::Stack
@api private
Constants
- RETURN
Public Class Methods
new(steps)
click to toggle source
# File lib/dry/transaction/stack.rb, line 9 def initialize(steps) @stack = compile(steps) end
Public Instance Methods
call(m)
click to toggle source
# File lib/dry/transaction/stack.rb, line 13 def call(m) @stack.(m) end
Private Instance Methods
compile(steps)
click to toggle source
# File lib/dry/transaction/stack.rb, line 19 def compile(steps) steps.reverse.reduce(RETURN) do |next_step, step| proc { |m| m.bind { |value| step.(value, next_step) } } end end