Class: Rollbar::Item::Frame
- Inherits:
-
Object
- Object
- Rollbar::Item::Frame
- Defined in:
- lib/rollbar/item/frame.rb
Overview
Representation of the trace data per frame in the payload
Constant Summary collapse
- MAX_CONTEXT_LENGTH =
4
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
readonly
Returns the value of attribute backtrace.
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#frame ⇒ Object
readonly
Returns the value of attribute frame.
Instance Method Summary collapse
-
#initialize(backtrace, frame, options = {}) ⇒ Frame
constructor
A new instance of Frame.
- #to_h ⇒ Object
Constructor Details
#initialize(backtrace, frame, options = {}) ⇒ Frame
Returns a new instance of Frame.
13 14 15 16 17 |
# File 'lib/rollbar/item/frame.rb', line 13 def initialize(backtrace, frame, = {}) @backtrace = backtrace @frame = frame @configuration = [:configuration] end |
Instance Attribute Details
#backtrace ⇒ Object (readonly)
Returns the value of attribute backtrace.
9 10 11 |
# File 'lib/rollbar/item/frame.rb', line 9 def backtrace @backtrace end |
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
9 10 11 |
# File 'lib/rollbar/item/frame.rb', line 9 def configuration @configuration end |
#frame ⇒ Object (readonly)
Returns the value of attribute frame.
9 10 11 |
# File 'lib/rollbar/item/frame.rb', line 9 def frame @frame end |
Instance Method Details
#to_h ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rollbar/item/frame.rb', line 19 def to_h # parse the line match = frame.match(/(.*):(\d+)(?::in `([^']+)')?/) return unknown_frame unless match filename = match[1] lineno = match[2].to_i frame_data = { :filename => filename, :lineno => lineno, :method => match[3] } frame_data.merge(extra_frame_data(filename, lineno)) end |