Class: Appsignal::EventFormatter::ActionView::RenderFormatter
- Inherits:
-
Appsignal::EventFormatter
- Object
- Appsignal::EventFormatter
- Appsignal::EventFormatter::ActionView::RenderFormatter
- Defined in:
- lib/appsignal/event_formatter/action_view/render_formatter.rb
Constant Summary collapse
- BLANK =
''.freeze
Instance Attribute Summary collapse
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
Instance Method Summary collapse
- #format(payload) ⇒ Object
-
#initialize ⇒ RenderFormatter
constructor
A new instance of RenderFormatter.
Methods inherited from Appsignal::EventFormatter
format, formatter_classes, formatters, initialize_formatters, register, registered?, unregister
Constructor Details
#initialize ⇒ RenderFormatter
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_path ⇒ Object (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 |