ruby-changes:2596
From: ko1@a...
Date: 2 Dec 2007 23:42:18 +0900
Subject: [ruby-changes:2596] akr - Ruby:r14087 (trunk): document MatchData#inspect.
akr 2007-12-02 23:42:05 +0900 (Sun, 02 Dec 2007)
New Revision: 14087
Modified files:
trunk/re.c
Log:
document MatchData#inspect.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/re.c?r1=14087&r2=14086
Index: re.c
===================================================================
--- re.c (revision 14086)
+++ re.c (revision 14087)
@@ -1221,6 +1221,19 @@
return RMATCH(match)->str; /* str is frozen */
}
+/*
+ * call-seq:
+ * mtch.inspect => str
+ *
+ * Returns a printable version of <i>mtch</i>.
+ *
+ * /.$/ =~ "foo"; puts $~.inspect
+ * #=> #<MatchData "o">
+ *
+ * /(.)(.)(.)/ =~ "foo"; puts $~.inspect
+ * #=> #<MatchData "foo" "f" "o" "o">
+ */
+
static VALUE
match_inspect(VALUE match)
{
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml