Class: Sentry::ThreadsInterface
- Inherits:
-
Object
- Object
- Sentry::ThreadsInterface
- Defined in:
- lib/sentry/interfaces/threads.rb
Class Method Summary collapse
-
.build(backtrace:, stacktrace_builder:, **options) ⇒ ThreadsInterface
Builds the ThreadsInterface with given backtrace and stacktrace_builder.
Instance Method Summary collapse
-
#initialize(crashed: false, stacktrace: nil) ⇒ ThreadsInterface
constructor
A new instance of ThreadsInterface.
- #to_hash ⇒ Hash
Constructor Details
#initialize(crashed: false, stacktrace: nil) ⇒ ThreadsInterface
Returns a new instance of ThreadsInterface.
7 8 9 10 11 12 13 |
# File 'lib/sentry/interfaces/threads.rb', line 7 def initialize(crashed: false, stacktrace: nil) @id = Thread.current.object_id @name = Thread.current.name @current = true @crashed = crashed @stacktrace = stacktrace end |
Class Method Details
.build(backtrace:, stacktrace_builder:, **options) ⇒ ThreadsInterface
Builds the ThreadsInterface with given backtrace and stacktrace_builder. Patch this method if you want to change a threads interface’s stacktrace frames.
37 38 39 40 |
# File 'lib/sentry/interfaces/threads.rb', line 37 def self.build(backtrace:, stacktrace_builder:, **) stacktrace = stacktrace_builder.build(backtrace: backtrace) if backtrace new(**, stacktrace: stacktrace) end |
Instance Method Details
#to_hash ⇒ Hash
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sentry/interfaces/threads.rb', line 16 def to_hash { values: [ { id: @id, name: @name, crashed: @crashed, current: @current, stacktrace: @stacktrace&.to_hash } ] } end |