Sha256: ad09d97af99312c37d17f3a4049db3cde11911ec608d6454d167dd8f013b63b5

Contents?: true

Size: 741 Bytes

Versions: 130

Compression:

Stored size: 741 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}/"
        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

130 entries across 130 versions & 1 rubygems

Version Path
appsignal-4.3.3-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.3.3 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.3.2-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.3.2 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.3.1-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.3.1 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.3.0-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.3.0 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.2.3-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.2.3 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.2.2-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.2.2 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.2.1-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.2.1 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.2.0-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.2.0 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.1.3-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.1.3 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.1.2-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-4.1.2 lib/appsignal/event_formatter/action_view/render_formatter.rb