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

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

Constant Summary collapse

BLANK =
''.freeze

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

Returns a new instance of RenderFormatter.



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

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

Instance Attribute Details

#root_pathObject (readonly)

Returns the value of attribute root_path.



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

def root_path
  @root_path
end

Instance Method Details

#format(payload) ⇒ Object



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

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