summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-18 04:18:06 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-18 04:18:06 +0000
commitec3226d826e9ec7381cdb53a0c45c153065bfdad (patch)
tree6867a1f5fda7d352725dfdd942b637d33486046c /vm_trace.c
parentdbc8565fa3b3afb227fc0e41acbcc1e395837bb7 (diff)
* vm_trace.c (tracepoint_attr_defined_class): Clean up rdoc for
TracePoint#defined_class git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c54
1 files changed, 28 insertions, 26 deletions
diff --git a/vm_trace.c b/vm_trace.c
index ec5fe4f2dd..558b6a87ce 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -835,36 +835,38 @@ tracepoint_attr_method_id(VALUE tpval)
}
/*
- * Return class or module the method being called.
+ * Return class or module of the method being called.
*
- * class C; def foo; end; end
- * trace = TracePoint.new(:call) do |tp|
- * tp.defined_class #=> C
- * end.enable do
- * C.new.foo
- * end
+ * class C; def foo; end; end
+ * trace = TracePoint.new(:call) do |tp|
+ * p tp.defined_class #=> C
+ * end.enable do
+ * C.new.foo
+ * end
*
- * If method is defined by a module, then returns that module.
+ * If method is defined by a module, then that module is returned.
*
- * module M; def foo; end; end
- * class C; include M; end;
- * trace = TracePoint.new(:call) do |tp|
- * tp.defined_class #=> M
- * end.enable do
- * C.new.foo
- * end
+ * module M; def foo; end; end
+ * class C; include M; end;
+ * trace = TracePoint.new(:call) do |tp|
+ * p tp.defined_class #=> M
+ * end.enable do
+ * C.new.foo
+ * end
*
- * Note that TracePont#defined_class returns singleton class.
- * 6th block parameter of `set_trace_func' passes original class
- * of attached by singleton class. This is a difference between
- * `set_trace_func' and TracePoint.
- *
- * class C; def self.foo; end; end
- * trace = TracePoint.new(:call) do |tp|
- * tp.defined_class #=> #<Class:C>
- * end.enable do
- * C.foo
- * end
+ * <b>Note:</b> #defined_class returns singleton class.
+ *
+ * 6th block parameter of Kernel#set_trace_func passes original class
+ * of attached by singleton class.
+ *
+ * <b>This is a difference between Kernel#set_trace_func and TracePoint.</b>
+ *
+ * class C; def self.foo; end; end
+ * trace = TracePoint.new(:call) do |tp|
+ * p tp.defined_class #=> #<Class:C>
+ * end.enable do
+ * C.foo
+ * end
*/
static VALUE
tracepoint_attr_defined_class(VALUE tpval)