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

ruby-changes:50466

From: nobu <ko1@a...>
Date: Tue, 27 Feb 2018 22:28:37 +0900 (JST)
Subject: [ruby-changes:50466] nobu:r62595 (trunk): random.c: Random.extend Formatter

nobu	2018-02-27 22:28:31 +0900 (Tue, 27 Feb 2018)

  New Revision: 62595

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62595

  Log:
    random.c: Random.extend Formatter
    
    * random.c (InitVM_Random): extend Random itself by Formatter
      module, as well as the `bytes` method used by the module.
      [Feature #4938]

  Modified files:
    trunk/random.c
Index: random.c
===================================================================
--- random.c	(revision 62594)
+++ random.c	(revision 62595)
@@ -1671,6 +1671,7 @@ InitVM_Random(void) https://github.com/ruby/ruby/blob/trunk/random.c#L1671
 	/* Format raw random number as Random does */
 	VALUE m = rb_define_module_under(rb_cRandom, "Formatter");
 	rb_include_module(rb_cRandom, m);
+	rb_extend_object(rb_cRandom, m);
 	rb_define_method(m, "random_number", rand_random_number, -1);
 	rb_define_method(m, "rand", rand_random_number, -1);
     }

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

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