Sha256: 53e364cab4fc29d6d52aab0b5354c98ca9794efe92bb84e407097a3e2ed0a541

Contents?: true

Size: 507 Bytes

Versions: 50

Compression:

Stored size: 507 Bytes

Contents

module Datadog
  # Represents an wrapped method, with a reference to the original block
  # and the block that wraps around it.
  class MethodWrapper
    attr_reader \
      :original,
      :wrapper

    DEFAULT_WRAPPER = proc { |original, *args, &block| original.call(*args, &block) }

    def initialize(original, &block)
      @original = original
      @wrapper = block_given? ? block : DEFAULT_WRAPPER
    end

    def call(*args, &block)
      wrapper.call(original, *args, &block)
    end
  end
end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
ddtrace-0.45.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.44.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.43.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.42.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.41.0 lib/ddtrace/augmentation/method_wrapper.rb
ls-trace-0.2.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.40.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.39.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.38.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.37.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.36.0 lib/ddtrace/augmentation/method_wrapper.rb
ls-trace-0.1.2 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.35.2 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.35.1 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.35.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.34.2 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.34.1 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.34.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.33.1 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.33.0 lib/ddtrace/augmentation/method_wrapper.rb