Class: Codebeacon::Tracer::TreeNode
- Inherits:
- 
      Object
      
        - Object
- Codebeacon::Tracer::TreeNode
 
- Defined in:
- lib/codebeacon/tracer/src/models/tree_node.rb
Defined Under Namespace
Classes: TraceStatus
Instance Attribute Summary collapse
- 
  
    
      #backtrace_count  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #backtrace_location  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #block  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #called_method  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #caller  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #children  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #depth  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #file  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #gem_entry  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #line  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #linevars  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #locals  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #method  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #node_source  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #object_id  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #parent  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #return_value  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #script  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #script_binding  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #script_self  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #self_type  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #tp_class  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #tp_class_name  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #tp_defined_class  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
- 
  
    
      #trace_status  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”) @file = file @line = line @method = method @depth = depth @caller = caller @gem_entry = gem_entry @parent = parent @block = block @locals = locals @ast = ast @return_value = return_value @linevars = {} @children = [] end. 
Instance Method Summary collapse
- #add_line(lineno, variables) ⇒ Object
- #depth_truncated? ⇒ Boolean
- 
  
    
      #initialize(file: nil, line: nil, object_id: nil, method: nil, tp_class: nil, tp_defined_class: nil, tp_class_name: nil, self_type: nil, depth: 0, caller: "", gem_entry: false, parent: nil, block: false, locals: [], return_value: nil, node_source: nil, script: false, called_method: nil)  ⇒ TreeNode 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of TreeNode. 
- #inspect ⇒ Object
- #inspect_tree(attrs = [], depth = 0) ⇒ Object
- #set_args(lineno, variables) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(file: nil, line: nil, object_id: nil, method: nil, tp_class: nil, tp_defined_class: nil, tp_class_name: nil, self_type: nil, depth: 0, caller: "", gem_entry: false, parent: nil, block: false, locals: [], return_value: nil, node_source: nil, script: false, called_method: nil) ⇒ TreeNode
Returns a new instance of TreeNode.
| 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 36 def initialize(file: nil, line: nil, object_id: nil, method: nil, tp_class: nil, tp_defined_class: nil, tp_class_name: nil, self_type: nil, depth: 0, caller: "", gem_entry: false, parent: nil, block: false, locals: [], return_value: nil, node_source: nil, script: false, called_method: nil) @file = file @line = line @method = method @object_id = object_id @tp_class = tp_class @tp_defined_class = tp_defined_class @tp_class_name = tp_class_name @self_type = self_type @children = [] @depth = depth @gem_entry = gem_entry @caller = caller @parent = parent @block = block @locals = locals @return_value = return_value @linevars = Hash.new { |h, k| h[k] = {} } @node_source = node_source @trace_status = TraceStatus.new(nil) @script = script @backtrace_count = 0 @backtrace_location = nil @script_binding = nil @script_self = nil @called_method = called_method end | 
Instance Attribute Details
#backtrace_count ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def backtrace_count @backtrace_count end | 
#backtrace_location ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def backtrace_location @backtrace_location end | 
#block ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def block @block end | 
#called_method ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def called_method @called_method end | 
#caller ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def caller @caller end | 
#children ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def children @children end | 
#depth ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def depth @depth end | 
#file ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def file @file end | 
#gem_entry ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def gem_entry @gem_entry end | 
#line ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def line @line end | 
#linevars ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def linevars @linevars end | 
#locals ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def locals @locals end | 
#method ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def method @method end | 
#node_source ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def node_source @node_source end | 
#object_id ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def object_id @object_id end | 
#parent ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def parent @parent end | 
#return_value ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def return_value @return_value end | 
#script ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def script @script end | 
#script_binding ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def script_binding @script_binding end | 
#script_self ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def script_self @script_self end | 
#self_type ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def self_type @self_type end | 
#tp_class ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def tp_class @tp_class end | 
#tp_class_name ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def tp_class_name @tp_class_name end | 
#tp_defined_class ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def tp_defined_class @tp_defined_class end | 
#trace_status ⇒ Object
def initialize(file: nil, line: nil, method: nil, depth: 0, caller: “”, gem_entry: false, parent: nil, block: false, locals: [], ast: nil, return_value: “”)
@file = file
@line = line
@method = method
@depth = depth
@caller = caller
@gem_entry = gem_entry
@parent = parent
@block = block
@locals = locals
@ast = ast
@return_value = return_value
@linevars = {}
@children = []
end
| 34 35 36 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 34 def trace_status @trace_status end | 
Instance Method Details
#add_line(lineno, variables) ⇒ Object
| 64 65 66 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 64 def add_line(lineno, variables) @linevars[lineno] = @linevars[lineno].merge(variables) end | 
#depth_truncated? ⇒ Boolean
| 109 110 111 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 109 def depth_truncated? @depth > Codebeacon::Tracer.config.max_depth && @children.count > 0 end | 
#inspect ⇒ Object
| 72 73 74 75 76 77 78 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 72 def inspect ivar_inspect = instance_variables.reject { |ivar| [:@children].include?(ivar) }.map do |ivar| "#{ivar.to_s}=#{instance_variable_get(ivar).inspect}" end ivar_inspect << "@children=#<#{@children.map(&:to_s)}>" "#<#{self.class.name}:0x#{self.object_id.to_s} #{ivar_inspect.join(', ')}>" end | 
#inspect_tree(attrs = [], depth = 0) ⇒ Object
| 80 81 82 83 84 85 86 87 88 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 80 def inspect_tree(attrs = [], depth = 0) str = file.split("/").last + ":#{script ? "script" : method}" if !attrs.empty? attr_values = attrs.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') str += " " + attrs end str += children.map { |c| "\n" + " " * (depth + 1) * 2 + c.inspect_tree(attrs, depth + 1) }.join() return str end | 
#set_args(lineno, variables) ⇒ Object
| 68 69 70 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 68 def set_args(lineno, variables) @linevars[lineno] = @linevars[lineno].merge(variables) end | 
#to_h ⇒ Object
| 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | # File 'lib/codebeacon/tracer/src/models/tree_node.rb', line 90 def to_h children = depth > Codebeacon::Tracer.config.max_depth ? nil : @children.map(&:to_h) is_truncated = depth > Codebeacon::Tracer.config.max_depth ? true : false { file: @file, line: @line, method: @method, class: @tp_class, tp_defined_class: @tp_defined_class, tp_class_name: @tp_class_name, class_name: @class_name, self_type: @self_type, gemEntry: @gem_entry, caller: @caller, isDepthTruncated: is_truncated, children: children } end |