From aed7b79c1edd642b9c2d28ea097f89c879b7d345 Mon Sep 17 00:00:00 2001 From: Gosha Arinich Date: Thu, 9 May 2013 22:51:50 +0300 Subject: [PATCH] alias MatchData#captures to #to_ary --- re.c | 1 + 1 file changed, 1 insertion(+) diff --git a/re.c b/re.c index fe7e390..296bee4 100644 --- a/re.c +++ b/re.c @@ -3599,6 +3599,7 @@ struct backref_name_tag { rb_define_method(rb_cMatch, "to_a", match_to_a, 0); rb_define_method(rb_cMatch, "[]", match_aref, -1); rb_define_method(rb_cMatch, "captures", match_captures, 0); + rb_define_alias(rb_cMatch, "to_ary", "captures"); rb_define_method(rb_cMatch, "values_at", match_values_at, -1); rb_define_method(rb_cMatch, "pre_match", rb_reg_match_pre, 0); rb_define_method(rb_cMatch, "post_match", rb_reg_match_post, 0); -- 1.8.1.6