Sha256: d903f3571d64285e946c7488831b412ad019085756e728cad1fed5ba8bf68712

Contents?: true

Size: 754 Bytes

Versions: 214

Compression:

Stored size: 754 Bytes

Contents

# frozen_string_literal: true

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

        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

214 entries across 214 versions & 1 rubygems

Version Path
appsignal-3.0.21.alpha.1-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.21.alpha.1 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.20-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.20 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.19-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.19 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.18-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.18 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.17-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.17 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.16-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.16 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.15-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.15 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.14-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.14 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.13-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.13 lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.12-java lib/appsignal/event_formatter/action_view/render_formatter.rb
appsignal-3.0.12 lib/appsignal/event_formatter/action_view/render_formatter.rb