class Sentry::ThreadsInterface

Public Class Methods

build(backtrace:, stacktrace_builder:, **options) click to toggle source

patch this method if you want to change a threads interface's stacktrace frames also see `StacktraceBuilder.build`.

# File lib/sentry/interfaces/threads.rb, line 27
def self.build(backtrace:, stacktrace_builder:, **options)
  stacktrace = stacktrace_builder.build(backtrace: backtrace) if backtrace
  new(**options, stacktrace: stacktrace)
end
new(crashed: false, stacktrace: nil) click to toggle source
# 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

Public Instance Methods

to_hash() click to toggle source
# 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