Sha256: 51184b6ccd91e54f93803268cf37d6367f98252d0a71461dc85e4fbd63e6a558

Contents?: true

Size: 748 Bytes

Versions: 20

Compression:

Stored size: 748 Bytes

Contents

# frozen_string_literal: true

module Appsignal
  class EventFormatter
    # @api private
    module ActionView
      class RenderFormatter
        BLANK = ""

        attr_reader :root_path

        def initialize
          @root_path = "#{Rails.root}/".freeze
        end

        def format(payload)
          return nil unless payload[:identifier]

          [payload[:identifier].sub(root_path, BLANK), nil]
        end
      end
    end
  end
end

if defined?(Rails)
  Appsignal::EventFormatter.register(
    "render_partial.action_view",
    Appsignal::EventFormatter::ActionView::RenderFormatter
  )
  Appsignal::EventFormatter.register(
    "render_template.action_view",
    Appsignal::EventFormatter::ActionView::RenderFormatter
  )
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
appsignal-3.4.10-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.10 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.9-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.9 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.8-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.8 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.7-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.7 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.6-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.6 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.5-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.5 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.4-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.4 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.3-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.3 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.2-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.2 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.1-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.4.1 lib/appsignal/event_formatter/action_view/render_formatter.rb