Sha256: a2a928eeabdda189963713d64dc07ba021d4d4bbb57e5bb5d234d725d9947a3e

Contents?: true

Size: 713 Bytes

Versions: 4

Compression:

Stored size: 713 Bytes

Contents

# frozen_string_literal: true

module Opera
  module Operation
    class Config
      attr_accessor :transaction_class, :transaction_method, :reporter

      def initialize
        @transaction_class = self.class.transaction_class
        @transaction_method = self.class.transaction_method || :transaction
        @reporter = custom_reporter || self.class.reporter
      end

      def configure
        yield self
      end

      def custom_reporter
        Rails.application.config.x.reporter.presence if defined?(Rails)
      end

      class << self
        attr_accessor :transaction_class, :transaction_method, :reporter

        def configure
          yield self
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opera-0.2.0 lib/opera/operation/config.rb
opera-0.1.2 lib/opera/operation/config.rb
opera-0.1.1 lib/opera/operation/config.rb
opera-0.1.0 lib/opera/operation/config.rb