Sha256: d6346a1f49d4007870db146116b941905fe8376c0a498804d63a58afc4cbce65

Contents?: true

Size: 819 Bytes

Versions: 15

Compression:

Stored size: 819 Bytes

Contents

# frozen_string_literal: true

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

      def initialize
        @transaction_class = self.class.transaction_class
        @transaction_method = self.class.transaction_method || :transaction
        @transaction_options = self.class.transaction_options
        @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, :transaction_options, :reporter

        def configure
          yield self
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
opera-0.2.15 lib/opera/operation/config.rb
opera-0.2.14 lib/opera/operation/config.rb
opera-0.2.13 lib/opera/operation/config.rb
opera-0.2.12 lib/opera/operation/config.rb
opera-0.2.11 lib/opera/operation/config.rb
opera-0.2.10 lib/opera/operation/config.rb
opera-0.2.9 lib/opera/operation/config.rb
opera-0.2.8 lib/opera/operation/config.rb
opera-0.2.7 lib/opera/operation/config.rb
opera-0.2.6 lib/opera/operation/config.rb
opera-0.2.5 lib/opera/operation/config.rb
opera-0.2.4 lib/opera/operation/config.rb
opera-0.2.3 lib/opera/operation/config.rb
opera-0.2.2 lib/opera/operation/config.rb
opera-0.2.1 lib/opera/operation/config.rb