| Class | Ruva::Utils::Class::TraceClassVisitor |
| In: |
lib/ruva/utils/class_visitor.rb
|
| Parent: | Object |
A debugging helper that allows you to dump out an UnresolvedClass.
# File lib/ruva/utils/class_visitor.rb, line 125
125: def initialize(name = nil, indent = 0, step = 4, stream = STDIN)
126: @indent, @name, @step = indent, name, step
127: end
# File lib/ruva/utils/class_visitor.rb, line 161
161: def iputs(*args)
162: print((' ' * @indent), *args)
163: end
# File lib/ruva/utils/class_visitor.rb, line 155
155: def method_missing(sym, *args)
156: if sym.to_s =~ /^visit/
157: iputs "(#{@name}).#{sym} -> #{args.inspect}\n"
158: end
159: end
# File lib/ruva/utils/class_visitor.rb, line 129
129: def visit(*args)
130: @name = args[3]
131: iputs "(#{@name}).visit -> #{args.inspect}\n"
132: @indent += @step
133: end
# File lib/ruva/utils/class_visitor.rb, line 140
140: def visit_annotation(*args)
141: iputs "(#{@name}).visit_annotation -> #{args.inspect}\n"
142: self.class.new("Annotation #{args[0]}", @indent + @step)
143: end
# File lib/ruva/utils/class_visitor.rb, line 135
135: def visit_end(*args)
136: @indent -= @step
137: iputs "(#{@name}).visit_end -> #{args.inspect}\n\n"
138: end
# File lib/ruva/utils/class_visitor.rb, line 145
145: def visit_field(*args)
146: iputs "(#{@name}).visit_field -> #{args.inspect}\n"
147: self.class.new("Field #{args[1]}", @indent + @step)
148: end