From 2af1761466890a7621d908b0b4b0b19560543ba2 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 27 Feb 2018 13:28:31 +0000 Subject: [PATCH] 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- random.c | 1 + 1 file changed, 1 insertion(+) diff --git a/random.c b/random.c index 88c05fbb20..f41ae7cfba 100644 --- a/random.c +++ b/random.c @@ -1671,6 +1671,7 @@ InitVM_Random(void) /* 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); }