summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-20 02:02:55 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-20 02:02:55 (GMT)
commit3b8730058e8dc7fbbb5b888ae5623739f80702c4 (patch)
tree18a02bb761bd5b5684fca41273f25604acfa7a7d /proc.c
parentc46ff1bb271afc2375b9b6786a0384426777e551 (diff)
* proc.c (rb_mod_define_method): fix notation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/proc.c b/proc.c
index 79a7829..cd083ec 100644
--- a/proc.c
+++ b/proc.c
@@ -1782,8 +1782,14 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod)
}
else {
body = argv[1];
- is_method = rb_obj_is_method(body) != Qfalse;
- if (!is_method && !rb_obj_is_proc(body)) {
+
+ if (rb_obj_is_method(body)) {
+ is_method = TRUE;
+ }
+ else if (rb_obj_is_proc(body)) {
+ is_method = FALSE;
+ }
+ else {
rb_raise(rb_eTypeError,
"wrong argument type %s (expected Proc/Method)",
rb_obj_classname(body));