Class: Chronos::Core::Notice
- Inherits:
-
Object
- Object
- Chronos::Core::Notice
- Defined in:
- lib/chronos/core/notice.rb
Overview
Immutable value object containing a normalized Ruby exception.
Constant Summary collapse
- ATTRIBUTES =
[ :event_id, :exception_class, :message, :backtrace, :causes, :severity, :timestamp, :context, :parameters, :session, :user, :environment, :runtime, :versions, :host, :process, :thread, :tags, :fingerprint ].freeze
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Notice
constructor
A new instance of Notice.
- #to_h ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Notice
Returns a new instance of Notice.
24 25 26 27 28 29 |
# File 'lib/chronos/core/notice.rb', line 24 def initialize(attributes) ATTRIBUTES.each do |attribute| instance_variable_set("@#{attribute}", deep_freeze(attributes[attribute])) end freeze end |
Instance Method Details
#to_h ⇒ Object
31 32 33 34 35 |
# File 'lib/chronos/core/notice.rb', line 31 def to_h ATTRIBUTES.each_with_object({}) do |attribute, result| result[attribute] = public_send(attribute) end end |