summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-27 13:28:31 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-27 13:28:31 (GMT)
commit2af1761466890a7621d908b0b4b0b19560543ba2 (patch)
tree600c3bae3e6d13f5d48ec12a1bc0b009b7d3ef75 /random.c
parent3406c5d61372e7b229cf2f925b89d5d9fd8728cd (diff)
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
Diffstat (limited to 'random.c')
-rw-r--r--random.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/random.c b/random.c
index 88c05fb..f41ae7c 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);
}