summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'class.c')
-rw-r--r--class.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/class.c b/class.c
index 8d237985b8..2bd6bb33e4 100644
--- a/class.c
+++ b/class.c
@@ -1786,8 +1786,11 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
}
else {
hash = rb_check_hash_type(last);
- if (!NIL_P(hash))
- argc--;
+ if (!NIL_P(hash)) {
+ VALUE opts = rb_extract_keywords(&hash);
+ if (!hash) argc--;
+ hash = opts;
+ }
}
}
/* capture leading mandatory arguments */