Class: Bugwatch::ExceptionData

Inherits:
Object
  • Object
show all
Defined in:
lib/bugwatch/exception_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ ExceptionData

Returns a new instance of ExceptionData.



37
38
39
40
# File 'lib/bugwatch/exception_data.rb', line 37

def initialize(opts={})
  @type = opts[:type]
  @backtrace = opts[:backtrace] || []
end

Instance Attribute Details

#backtraceObject (readonly)

Returns the value of attribute backtrace.



35
36
37
# File 'lib/bugwatch/exception_data.rb', line 35

def backtrace
  @backtrace
end

#typeObject (readonly)

Returns the value of attribute type.



35
36
37
# File 'lib/bugwatch/exception_data.rb', line 35

def type
  @type
end

Instance Method Details

#fileObject



42
43
44
# File 'lib/bugwatch/exception_data.rb', line 42

def file
  files.first
end

#filesObject



51
52
53
# File 'lib/bugwatch/exception_data.rb', line 51

def files
  backtrace.map(&:first)
end

#lineObject



46
47
48
49
# File 'lib/bugwatch/exception_data.rb', line 46

def line
  _, line = backtrace.first
  line.to_i if line
end