Class: RedmineAirbrakeBackend::BacktraceElement

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine_airbrake_backend/backtrace_element.rb

Overview

Backtrace element received by airbrake

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ BacktraceElement

Returns a new instance of BacktraceElement.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/redmine_airbrake_backend/backtrace_element.rb', line 9

def initialize(data)
  # File
  @file = data[:file].presence

  # Line
  @line = data[:line].presence

  # Function
  @function = data[:function].presence

  # Column
  @column = data[:column].presence
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



7
8
9
# File 'lib/redmine_airbrake_backend/backtrace_element.rb', line 7

def column
  @column
end

#fileObject (readonly)

Returns the value of attribute file.



7
8
9
# File 'lib/redmine_airbrake_backend/backtrace_element.rb', line 7

def file
  @file
end

#functionObject (readonly)

Returns the value of attribute function.



7
8
9
# File 'lib/redmine_airbrake_backend/backtrace_element.rb', line 7

def function
  @function
end

#lineObject (readonly)

Returns the value of attribute line.



7
8
9
# File 'lib/redmine_airbrake_backend/backtrace_element.rb', line 7

def line
  @line
end

Instance Method Details

#checksumObject



23
24
25
# File 'lib/redmine_airbrake_backend/backtrace_element.rb', line 23

def checksum
  @_checksum ||= Digest::MD5.hexdigest("#{@file}|#{normalize_function_name(@function)}|#{@line}|#{@column}")
end