[前][次][番号順一覧][スレッド一覧]

ruby-changes:27355

From: marcandre <ko1@a...>
Date: Sat, 23 Feb 2013 08:20:19 +0900 (JST)
Subject: [ruby-changes:27355] marcandRe: r39407 (trunk): * object.c: Add doc for Module.prepended

marcandre	2013-02-23 08:18:33 +0900 (Sat, 23 Feb 2013)

  New Revision: 39407

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39407

  Log:
    * object.c: Add doc for Module.prepended

  Modified files:
    trunk/object.c

Index: object.c
===================================================================
--- object.c	(revision 39406)
+++ object.c	(revision 39407)
@@ -790,6 +790,26 @@ rb_obj_tap(VALUE obj) https://github.com/ruby/ruby/blob/trunk/object.c#L790
  *        module Enumerable
  *          include A
  *        end
+ *         # => prints "A included in Enumerable"
+ */
+
+/*
+ * Document-method: prepended
+ *
+ * call-seq:
+ *    prepended( othermod )
+ *
+ * The equivalent of <tt>included</tt>, but for prepended modules.
+ *
+ *        module A
+ *          def self.prepended(mod)
+ *            puts "#{self} prepended to #{mod}"
+ *          end
+ *        end
+ *        module Enumerable
+ *          prepend A
+ *        end
+ *         # => prints "A prepended to Enumerable"
  */
 
 /*

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]