Class: CloseYourIt::Breadcrumb
- Inherits:
-
Object
- Object
- CloseYourIt::Breadcrumb
- Defined in:
- lib/closeyourit/breadcrumb.rb
Overview
Singola briciola di contesto (query, navigazione, evento custom) precedente a un errore. Forma evento Sentry (‘breadcrumbs.values[]`). Il `data` è già scrubato a monte (module API).
Instance Method Summary collapse
-
#initialize(message: nil, category: nil, type: "default", level: "info", data: {}, timestamp: nil) ⇒ Breadcrumb
constructor
A new instance of Breadcrumb.
- #to_h ⇒ Object
Constructor Details
#initialize(message: nil, category: nil, type: "default", level: "info", data: {}, timestamp: nil) ⇒ Breadcrumb
Returns a new instance of Breadcrumb.
9 10 11 12 13 14 15 16 |
# File 'lib/closeyourit/breadcrumb.rb', line 9 def initialize(message: nil, category: nil, type: "default", level: "info", data: {}, timestamp: nil) @timestamp = || Time.now.utc.iso8601 @type = type @category = category @level = level @message = @data = data end |
Instance Method Details
#to_h ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/closeyourit/breadcrumb.rb', line 18 def to_h { "timestamp" => @timestamp, "type" => @type, "category" => @category, "level" => @level, "message" => @message, "data" => presence(@data) }.reject { |_key, value| value.nil? } end |