diff options
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -1241,6 +1241,21 @@ rb_mod_to_s(klass) /* * call-seq: + * mod.freeze + * + * Prevents further modifications to <i>mod</i>. + */ + +static VALUE +rb_mod_freeze(mod) + VALUE mod; +{ + rb_mod_to_s(mod); + return rb_obj_freeze(mod); +} + +/* + * call-seq: * mod === obj => true or false * * Case Equality---Returns <code>true</code> if <i>anObject</i> is an @@ -2570,6 +2585,7 @@ Init_Object() rb_define_method(rb_cSymbol, "id2name", sym_to_s, 0); rb_define_method(rb_cSymbol, "to_sym", sym_to_sym, 0); + rb_define_method(rb_cModule, "freeze", rb_mod_freeze, 0); rb_define_method(rb_cModule, "===", rb_mod_eqq, 1); rb_define_method(rb_cModule, "==", rb_obj_equal, 1); rb_define_method(rb_cModule, "<=>", rb_mod_cmp, 1); |