Module: Dry::Transaction

Defined in:
lib/dry/transaction.rb,
lib/dry/transaction/dsl.rb,
lib/dry/transaction/step.rb,
lib/dry/transaction/stack.rb,
lib/dry/transaction/errors.rb,
lib/dry/transaction/builder.rb,
lib/dry/transaction/version.rb,
lib/dry/transaction/callable.rb,
lib/dry/transaction/operation.rb,
lib/dry/transaction/step_adapter.rb,
lib/dry/transaction/step_failure.rb,
lib/dry/transaction/step_adapters.rb,
lib/dry/transaction/result_matcher.rb,
lib/dry/transaction/instance_methods.rb,
lib/dry/transaction/step_adapters/map.rb,
lib/dry/transaction/step_adapters/raw.rb,
lib/dry/transaction/step_adapters/tee.rb,
lib/dry/transaction/step_adapters/try.rb,
lib/dry/transaction/operation_resolver.rb,
lib/dry/transaction/step_adapters/check.rb,
lib/dry/transaction/step_adapters/around.rb

Overview

Business transaction DSL.

Defined Under Namespace

Modules: InstanceMethods, Operation Classes: Builder, Callable, DSL, InvalidResultError, InvalidStepError, MissingCatchListError, MissingStepError, OperationResolver, Stack, Step, StepAdapter, StepAdapters, StepFailure

Constant Summary collapse

VERSION =
"0.16.0"
ResultMatcher =
Dry::Matcher.new(
  success: Dry::Matcher::Case.new(
    match: -> result { result.success? },
    resolve: -> result { result.value! }
  ),
  failure: Dry::Matcher::Case.new(
    match: -> result, step_name = nil {
      if step_name
        result.failure? && result.failure.step.name == step_name
      else
        result.failure?
      end
    },
    resolve: -> result { result.failure.value }
  )
)

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



15
16
17
# File 'lib/dry/transaction.rb', line 15

def self.included(klass)
  klass.include(Dry::Transaction())
end