From a28d1eff6534328cae5363bbf0cc26cd0a18b948 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 14 Aug 2013 05:35:21 +0000 Subject: * proc.c (rb_mod_define_method): now they return the symbols of the defined methods, not the methods/procs themselves. [ruby-dev:42151] [Feature #3753] * NEWS: documents about above change and def-expr (see r42337). * test/ruby/test_module.rb: tests about above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 6fd3981ef6..e45d30bd8e 100644 --- a/proc.c +++ b/proc.c @@ -1569,8 +1569,8 @@ rb_mod_public_instance_method(VALUE mod, VALUE vid) /* * call-seq: - * define_method(symbol, method) -> new_method - * define_method(symbol) { block } -> proc + * define_method(symbol, method) -> symbol + * define_method(symbol) { block } -> symbol * * Defines an instance method in the receiver. The _method_ * parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object. @@ -1667,7 +1667,7 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod) rb_raise(rb_eTypeError, "wrong argument type (expected Proc/Method)"); } - return body; + return ID2SYM(id); } /* -- cgit v1.2.3