Class: MethodCallTree
- Inherits:
-
Object
- Object
- MethodCallTree
- Defined in:
- lib/method_call_tree.rb,
lib/method_call_tree/version.rb
Constant Summary collapse
- SPACE_SIZE =
8- T_LINE =
'├─────'- I_LINE =
'│'- L_LINE =
'└─────'- VERSION =
"1.0.0"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ MethodCallTree
constructor
A new instance of MethodCallTree.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ MethodCallTree
Returns a new instance of MethodCallTree.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/method_call_tree.rb', line 13 def initialize @tree = Hash.new @queue = [] tracer.enable { yield } @tree.each do |root, tree| walk(root, tree) end end |
Class Method Details
.create(&block) ⇒ Object
9 10 11 |
# File 'lib/method_call_tree.rb', line 9 def self.create(&block) new(&block) end |
Instance Method Details
#to_s ⇒ Object
24 25 26 |
# File 'lib/method_call_tree.rb', line 24 def to_s @queue.join end |