Sha256: 85a491d75748cba7e99d0870947d0f4309a17e2fbd35bbb9b463314d1eecd2d2

Contents?: true

Size: 602 Bytes

Versions: 12

Compression:

Stored size: 602 Bytes

Contents

require "dry-configurable"
require "dry-transaction"

module <%= config[:camel_cased_app_name] %>
  class Transactions
    extend Dry::Configurable

    attr_reader :options

    setting :container
    setting :options, {}

    def self.define(&block)
      yield(new(options))
    end

    def self.options
      {container: config.container}.merge(config.options)
    end

    def initialize(options)
      @options = options
    end

    def container
      options[:container]
    end

    def define(name, &block)
      container.register(name, Dry.Transaction(options, &block))
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dry-web-roda-0.6.3 lib/dry/web/roda/skeletons/umbrella_project/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.6.2 lib/dry/web/roda/skeletons/umbrella_project/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.6.1 lib/dry/web/roda/skeletons/umbrella_project/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.6.0 lib/dry/web/roda/skeletons/umbrella/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.5.1 lib/dry/web/roda/skeletons/umbrella/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.5.0 lib/dry/web/roda/skeletons/umbrella/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.4.0 lib/dry/web/roda/skeletons/umbrella/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.3.0 lib/dry/web/roda/skeletons/umbrella/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.2.3 lib/dry/web/roda/skeletons/umbrella/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.2.2 lib/dry/web/roda/skeletons/umbrella/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.2.1 lib/dry/web/roda/skeletons/umbrella/lib/__underscored_app_name__/transactions.rb.tt
dry-web-roda-0.2.0 lib/dry/web/roda/skeletons/umbrella/lib/__underscored_app_name__/transactions.rb.tt