Class: Sentry::ThreadsInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/sentry/interfaces/threads.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(crashed: false) ⇒ ThreadsInterface

Returns a new instance of ThreadsInterface.



5
6
7
8
9
10
# File 'lib/sentry/interfaces/threads.rb', line 5

def initialize(crashed: false)
  @id = Thread.current.object_id
  @name = Thread.current.name
  @current = true
  @crashed = crashed
end

Instance Attribute Details

#stacktraceObject

Returns the value of attribute stacktrace.



3
4
5
# File 'lib/sentry/interfaces/threads.rb', line 3

def stacktrace
  @stacktrace
end

Instance Method Details

#to_hashObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/sentry/interfaces/threads.rb', line 12

def to_hash
  {
    values: [
      {
        id: @id,
        name: @name,
        crashed: @crashed,
        current: @current,
        stacktrace: @stacktrace&.to_hash
      }
    ]
  }
end