Sha256: 31d2bb8e5737d0064411248d3a9e6662a62b7c99d3542c1b4422912842ed1764

Contents?: true

Size: 674 Bytes

Versions: 18

Compression:

Stored size: 674 Bytes

Contents

module Dry
  module Mutations
    module Transactions # :nodoc:
      # http://dry-rb.org/gems/dry-transaction/custom-step-adapters/
      # step adapters must provide a single `#call(step, *args, input)` method,
      #   which should return the step’s result wrapped in an `Either` object.
      # This one is a wrapper for neted chains
      class Chain < StepAdapters::Move
        def call(step, *args, input)
          if step.block
            Class.new do
              extend ::Dry::Mutations::Transactions::DSL
              chain(&step.block)
            end.(input, *args)
          else
            super
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dry-mutations-1.6.0 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.5.7 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.5.6 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.5.5 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.5.4 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.5.3 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.5.2 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.5.1 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.5.0 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.3.6 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.3.5 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.3.4 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.3.3 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.3.2 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.3.1 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.1.3 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.1.1 lib/dry/mutations/transactions/step_adapters/chain.rb
dry-mutations-1.1.0 lib/dry/mutations/transactions/step_adapters/chain.rb