Class: Depdump::Tracer
- Inherits:
-
Object
- Object
- Depdump::Tracer
- Defined in:
- lib/depdump/tracer.rb
Instance Attribute Summary collapse
-
#classes ⇒ Object
readonly
Returns the value of attribute classes.
-
#registry_tree ⇒ Object
readonly
Returns the value of attribute registry_tree.
-
#relations ⇒ Object
readonly
Returns the value of attribute relations.
Instance Method Summary collapse
-
#initialize ⇒ Tracer
constructor
A new instance of Tracer.
- #trace_node(node, namespaces = []) ⇒ Object
Constructor Details
Instance Attribute Details
#classes ⇒ Object (readonly)
Returns the value of attribute classes.
3 4 5 |
# File 'lib/depdump/tracer.rb', line 3 def classes @classes end |
#registry_tree ⇒ Object (readonly)
Returns the value of attribute registry_tree.
3 4 5 |
# File 'lib/depdump/tracer.rb', line 3 def registry_tree @registry_tree end |
#relations ⇒ Object (readonly)
Returns the value of attribute relations.
3 4 5 |
# File 'lib/depdump/tracer.rb', line 3 def relations @relations end |
Instance Method Details
#trace_node(node, namespaces = []) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/depdump/tracer.rb', line 10 def trace_node(node, namespaces = []) return unless node.respond_to?(:type) case node.type when :class, :module trace_class(node, namespaces) when :const trace_const(node, namespaces) else node.children.map { |n| trace_node(n, namespaces) } end end |