Sha256: 6ccd8cd72f1482e69845dae7ff7610f876720ca2f5a95509398a622228b0dc0b

Contents?: true

Size: 436 Bytes

Versions: 9

Compression:

Stored size: 436 Bytes

Contents

require_relative 'container'
require 'dry-transaction'

module Main
  module Requests
    class Registrar
      attr_reader :container

      def initialize(container)
        @container = container
      end

      def define(identifier, &block)
        container.register(identifier, Dry.Transaction(container: container, &block))
      end
    end

    def self.define(&block)
      yield(Registrar.new(Container))
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dry-web-roda-0.5.1 spec/dummy/apps/main/system/main/requests.rb
dry-web-roda-0.5.0 spec/dummy/apps/main/system/main/requests.rb
dry-web-roda-0.4.0 spec/dummy/apps/main/system/main/requests.rb
dry-web-roda-0.3.0 spec/dummy/apps/main/component/main/requests.rb
dry-web-roda-0.2.3 spec/dummy/apps/main/component/main/requests.rb
dry-web-roda-0.2.2 spec/dummy/apps/main/component/main/requests.rb
dry-web-roda-0.2.1 spec/dummy/apps/main/component/main/requests.rb
dry-web-roda-0.2.0 spec/dummy/apps/main/component/main/requests.rb
dry-web-roda-0.1.0 spec/dummy/apps/main/core/main/requests.rb