Class: TraceViz::TraceData::RootNode

Inherits:
Node
  • Object
show all
Defined in:
lib/trace_viz/trace_data/root_node.rb

Instance Attribute Summary

Attributes inherited from Node

#children, #parent

Attributes included from TraceViz::Traits::TimeTrackable

#timestamp

Attributes included from TraceViz::Traits::DepthTrackable

#depth

Instance Method Summary collapse

Methods inherited from Node

#add_child, #add_children, #to_h

Methods inherited from Base

#action, #event, #key, #klass, #line_number, #path, #to_h

Methods included from TraceViz::Traits::TimeTrackable

#record_timestamp

Methods included from TraceViz::Traits::DepthTrackable

#assign_depth

Methods included from Helpers::ConfigHelper

#config, #fetch_general_config

Constructor Details

#initializeRootNode

Returns a new instance of RootNode.



8
9
10
11
12
13
# File 'lib/trace_viz/trace_data/root_node.rb', line 8

def initialize
  super()

  # Explicitly ensure no parent for root
  @parent = nil
end

Instance Method Details

#parent=(_parent) ⇒ Object

Raises:

  • (NoMethodError)


19
20
21
# File 'lib/trace_viz/trace_data/root_node.rb', line 19

def parent=(_parent)
  raise NoMethodError, "RootNode cannot have a parent"
end

#root?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/trace_viz/trace_data/root_node.rb', line 15

def root?
  true
end