Sha256: bfd07b57f6509081a510ff1e9bebf383fa37c373171b6ed39bb5650666a4fcaf

Contents?: true

Size: 750 Bytes

Versions: 4

Compression:

Stored size: 750 Bytes

Contents

# typed: false

require 'datadog/tracing/contrib/active_model_serializers/events/render'
require 'datadog/tracing/contrib/active_model_serializers/events/serialize'

module Datadog
  module Tracing
    module Contrib
      module ActiveModelSerializers
        # Defines collection of instrumented ActiveModelSerializers events
        module Events
          ALL = [
            Events::Render,
            Events::Serialize
          ].freeze

          module_function

          def all
            self::ALL
          end

          def subscriptions
            all.collect(&:subscriptions).collect(&:to_a).flatten
          end

          def subscribe!
            all.each(&:subscribe!)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ddtrace-1.2.0 lib/datadog/tracing/contrib/active_model_serializers/events.rb
ddtrace-1.1.0 lib/datadog/tracing/contrib/active_model_serializers/events.rb
ddtrace-1.0.0 lib/datadog/tracing/contrib/active_model_serializers/events.rb
ddtrace-1.0.0.beta2 lib/datadog/tracing/contrib/active_model_serializers/events.rb