summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-14 23:54:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-14 23:54:06 +0000
commitba2147ba40a147c10da3f8e202b4f78488bab6d9 (patch)
tree9f279add5f9f86d3340ec0be83469291a2601bbc /hash.c
parent83e19791ef93da8f13eab296abcc2d9afe320ab8 (diff)
* eval.c (rb_method_node): new API to retrieve method body.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 75c0779..b2a1769 100644
--- a/hash.c
+++ b/hash.c
@@ -41,6 +41,14 @@ rb_hash_freeze(hash)
return rb_obj_freeze(hash);
}
+static VALUE
+rb_hash_frozen_p(hash)
+ VALUE hash;
+{
+ if (OBJ_FROZEN(hash)) return Qtrue;
+ return Qfalse;
+}
+
VALUE rb_cHash;
static VALUE envtbl;
@@ -1789,6 +1797,7 @@ Init_Hash()
rb_define_method(rb_cHash,"to_a", rb_hash_to_a, 0);
rb_define_method(rb_cHash,"to_s", rb_hash_to_s, 0);
rb_define_method(rb_cHash,"inspect", rb_hash_inspect, 0);
+ rb_define_method(rb_cHash,"frozen?", rb_hash_frozen_p, 0);
rb_define_method(rb_cHash,"==", rb_hash_equal, 1);
rb_define_method(rb_cHash,"[]", rb_hash_aref, 1);