Class: MethodCallTree
- Inherits:
-
Object
- Object
- MethodCallTree
- Defined in:
- lib/method_call_tree.rb,
lib/method_call_tree/version.rb
Constant Summary collapse
- GET_ARGUMENTS =
<<-'TEXT'.freeze method(__method__).parameters.map { |_t, v| "#{v} = #{eval(v.to_s).inspect}" }.join(', ') TEXT
- SPACE_SIZE =
8- T_LINE =
'├─────'.freeze
- I_LINE =
'│'.freeze
- L_LINE =
'└─────'.freeze
- VERSION =
'1.2.0'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ MethodCallTree
constructor
A new instance of MethodCallTree.
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ MethodCallTree
Returns a new instance of MethodCallTree.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/method_call_tree.rb', line 19 def initialize() @args = [:args] @class = [:class] @tree = {} @queue = [] tracer.enable { yield } @tree.each do |root, tree| walk(root, tree) end end |
Class Method Details
.create(options = {}, &block) ⇒ Object
15 16 17 |
# File 'lib/method_call_tree.rb', line 15 def self.create( = {}, &block) new(, &block) end |
Instance Method Details
#to_s ⇒ Object
32 33 34 |
# File 'lib/method_call_tree.rb', line 32 def to_s @queue.join end |