Class: Sentry::ThreadsInterface
- Defined in:
- lib/sentry/interfaces/threads.rb
Class Method Summary collapse
-
.build(backtrace:, stacktrace_builder:, **options) ⇒ Object
patch this method if you want to change a threads interface’s stacktrace frames also see
StacktraceBuilder.build.
Instance Method Summary collapse
-
#initialize(crashed: false, stacktrace: nil) ⇒ ThreadsInterface
constructor
A new instance of ThreadsInterface.
- #to_hash ⇒ Object
Constructor Details
#initialize(crashed: false, stacktrace: nil) ⇒ ThreadsInterface
Returns a new instance of ThreadsInterface.
3 4 5 6 7 8 9 |
# File 'lib/sentry/interfaces/threads.rb', line 3 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) ⇒ Object
patch this method if you want to change a threads interface’s stacktrace frames also see StacktraceBuilder.build.
27 28 29 30 |
# File 'lib/sentry/interfaces/threads.rb', line 27 def self.build(backtrace:, stacktrace_builder:, **) stacktrace = stacktrace_builder.build(backtrace: backtrace) if backtrace new(**, stacktrace: stacktrace) end |
Instance Method Details
#to_hash ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sentry/interfaces/threads.rb', line 11 def to_hash { values: [ { id: @id, name: @name, crashed: @crashed, current: @current, stacktrace: @stacktrace&.to_hash } ] } end |