Class: RequireProfiler::Reporter::Node

Inherits:
Struct
  • Object
show all
Defined in:
lib/require_profiler/reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNode

Returns a new instance of Node.



9
10
11
12
13
# File 'lib/require_profiler/reporter.rb', line 9

def initialize(...)
  super
  self.children ||= []
  self.focused = false
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children

Returns:

  • (Object)

    the current value of children



8
9
10
# File 'lib/require_profiler/reporter.rb', line 8

def children
  @children
end

#focusedObject

Returns the value of attribute focused

Returns:

  • (Object)

    the current value of focused



8
9
10
# File 'lib/require_profiler/reporter.rb', line 8

def focused
  @focused
end

#parentObject

Returns the value of attribute parent

Returns:

  • (Object)

    the current value of parent



8
9
10
# File 'lib/require_profiler/reporter.rb', line 8

def parent
  @parent
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



8
9
10
# File 'lib/require_profiler/reporter.rb', line 8

def path
  @path
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



8
9
10
# File 'lib/require_profiler/reporter.rb', line 8

def time
  @time
end

Instance Method Details

#focused!Object



15
16
17
18
# File 'lib/require_profiler/reporter.rb', line 15

def focused!
  self.focused = true
  parent&.focused!
end