summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 36d5a86760..4841cbb198 100644
--- a/hash.c
+++ b/hash.c
@@ -4349,6 +4349,12 @@ rb_hash_to_proc(VALUE hash)
return rb_func_proc_new(hash_proc_call, hash);
}
+static VALUE
+rb_hash_deconstruct_keys(VALUE hash, VALUE keys)
+{
+ return hash;
+}
+
static int
add_new_i(st_data_t *key, st_data_t *val, st_data_t arg, int existing)
{
@@ -6020,6 +6026,8 @@ Init_Hash(void)
rb_define_method(rb_cHash, ">=", rb_hash_ge, 1);
rb_define_method(rb_cHash, ">", rb_hash_gt, 1);
+ rb_define_method(rb_cHash, "deconstruct_keys", rb_hash_deconstruct_keys, 1);
+
/* Document-class: ENV
*
* ENV is a hash-like accessor for environment variables.