Sha256: 33352385786312462049df0e4ca75c78b8dae9deb6ac166c43546ae4ef8bd458

Contents?: true

Size: 637 Bytes

Versions: 4

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true

require 'dry/transaction/step'
require 'dry/transaction/dsl'
require 'dry/transaction/instance_methods'
require 'dry/transaction/operation_resolver'

module Dry
  module Transaction
    class Builder < Module
      attr_reader :dsl_mod
      attr_reader :resolver_mod

      def initialize(container: nil, step_adapters:)
        @dsl_mod = DSL.new(step_adapters: step_adapters)
        @resolver_mod = OperationResolver.new(container)
      end

      def included(klass)
        klass.extend(dsl_mod)
        klass.include(InstanceMethods)
        klass.prepend(resolver_mod)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dry-transaction-0.14.0 lib/dry/transaction/builder.rb
dry-transaction-0.13.3 lib/dry/transaction/builder.rb
dry-transaction-0.13.2 lib/dry/transaction/builder.rb
dry-transaction-0.13.1 lib/dry/transaction/builder.rb