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.32.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.31.1 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.31.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.30.1 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.30.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.29.1 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.26.1 lib/ddtrace/augmentation/method_wrapper.rb
ls-trace-0.1.1 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.29.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.28.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.27.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.26.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.25.1 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.25.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.24.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.23.3 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.23.2 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.23.1 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.23.0 lib/ddtrace/augmentation/method_wrapper.rb
ddtrace-0.22.0 lib/ddtrace/augmentation/method_wrapper.rb