Class: Appsignal::EventFormatter::ViewComponent::RenderFormatter Private

Inherits:
Object
  • Object
show all
Defined in:
lib/appsignal/event_formatter/view_component/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.

""

Instance Attribute Summary collapse

Instance Method Summary collapse

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.



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

def initialize
  @root_path = "#{Rails.root}/"
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.



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

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.



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

def format(payload)
  [payload[:name], payload[:identifier].sub(@root_path, BLANK)]
end