Class: Contrast::Agent::Telemetry::Exception::StackFrame
- Defined in:
- lib/contrast/agent/telemetry/exception/stack_frame.rb
Overview
This class will hold the all the information for the specific exception and will be passed in the Exception message itself
Constant Summary collapse
- VALIDATIONS =
{ function: { required: true, range: 1..256 }, type: { required: true, range: 1..256 }, module_name: { required: false, range: 1..256 } }.cs__freeze
Instance Attribute Summary collapse
-
#function ⇒ String
readonly
The function of the stack trace.
-
#in_contrast ⇒ Boolean
Is it in contrast.
- #module_name ⇒ String
-
#type ⇒ String
readonly
The type of the exception itself.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(function, type) ⇒ StackFrame
constructor
A new instance of StackFrame.
- #to_controlled_hash ⇒ Object
Constructor Details
#initialize(function, type) ⇒ StackFrame
Returns a new instance of StackFrame.
32 33 34 35 36 37 38 |
# File 'lib/contrast/agent/telemetry/exception/stack_frame.rb', line 32 def initialize function, type super() @function = function @type = type @in_contrast = false validate(VALIDATIONS) end |
Instance Attribute Details
#function ⇒ String (readonly)
Returns the function of the stack trace.
23 24 25 |
# File 'lib/contrast/agent/telemetry/exception/stack_frame.rb', line 23 def function @function end |
#in_contrast ⇒ Boolean
Returns Is it in contrast.
26 27 28 |
# File 'lib/contrast/agent/telemetry/exception/stack_frame.rb', line 26 def in_contrast @in_contrast end |
#module_name ⇒ String
29 30 31 |
# File 'lib/contrast/agent/telemetry/exception/stack_frame.rb', line 29 def module_name @module_name end |
#type ⇒ String (readonly)
Returns The type of the exception itself.
20 21 22 |
# File 'lib/contrast/agent/telemetry/exception/stack_frame.rb', line 20 def type @type end |
Class Method Details
.build(method, type, module_name = nil) ⇒ Object
56 57 58 59 60 61 |
# File 'lib/contrast/agent/telemetry/exception/stack_frame.rb', line 56 def build method, type, module_name = nil inst = new(method, type) inst.module_name = module_name if module_name inst.in_contrast = type.include?('lib/contrast') inst end |
Instance Method Details
#to_controlled_hash ⇒ Object
47 48 49 50 |
# File 'lib/contrast/agent/telemetry/exception/stack_frame.rb', line 47 def to_controlled_hash super { function: function, type: type, module: module_name, inContrast: in_contrast }.compact end |