Class: Appsignal::EventFormatter::ActionView::RenderFormatter Private

Inherits:
Appsignal::EventFormatter show all
Defined in:
lib/appsignal/event_formatter/action_view/render_formatter.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

BLANK =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

"".freeze

Constants inherited from Appsignal::EventFormatter

DEFAULT, SQL_BODY_FORMAT

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Appsignal::EventFormatter

format, formatter_classes, formatters, initialize_formatters, register, registered?, unregister

Constructor Details

#initializeRenderFormatter

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of RenderFormatter.



13
14
15
# File 'lib/appsignal/event_formatter/action_view/render_formatter.rb', line 13

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

Instance Attribute Details

#root_pathObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/appsignal/event_formatter/action_view/render_formatter.rb', line 11

def root_path
  @root_path
end

Instance Method Details

#format(payload) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



17
18
19
20
# File 'lib/appsignal/event_formatter/action_view/render_formatter.rb', line 17

def format(payload)
  return nil unless payload[:identifier]
  [payload[:identifier].sub(root_path, BLANK), nil]
end