From 5208d2f440ec3175dc48ba5672413bb3b5cb4fd7 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Tue, 11 Mar 2025 17:07:40 -0500 Subject: [DOC] Tweaks for Hash#shift --- hash.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hash.c b/hash.c index 1e7ac2c7bd..fc56ad86f9 100644 --- a/hash.c +++ b/hash.c @@ -2480,14 +2480,16 @@ shift_i_safe(VALUE key, VALUE value, VALUE arg) * call-seq: * shift -> [key, value] or nil * - * Removes the first hash entry - * (see {Entry Order}[rdoc-ref:Hash@Entry+Order]); - * returns a 2-element Array containing the removed key and value: + * Removes and returns the first entry of +self+ as a 2-element array; + * see {Entry Order}[rdoc-ref:Hash@Entry+Order]: + * * h = {foo: 0, bar: 1, baz: 2} * h.shift # => [:foo, 0] - * h # => {bar: 1, baz: 2} + * h # => {bar: 1, baz: 2} + * + * Returns +nil+ if +self+ is empty. * - * Returns nil if the hash is empty. + * Related: see {Methods for Deleting}[rdoc-ref:Hash@Methods+for+Deleting]. */ static VALUE -- cgit v1.2.3