File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -2579,17 +2579,18 @@ rb_hash_delete_if(VALUE hash)
25792579 * reject! {|key, value| ... } -> self or nil
25802580 * reject! -> new_enumerator
25812581 *
2582- * Returns +self+, whose remaining entries are those
2583- * for which the block returns +false+ or +nil+:
2582+ * With a block given, calls the block with each entry's key and value;
2583+ * removes the entry from +self+ if the block returns a truthy value.
2584+ *
2585+ * Return +self+ if any entries were removed, +nil+ otherwise:
2586+ *
25842587 * h = {foo: 0, bar: 1, baz: 2}
25852588 * h.reject! {|key, value| value < 2 } # => {baz: 2}
2589+ * h.reject! {|key, value| value < 2 } # => nil
25862590 *
2587- * Returns +nil+ if no entries are removed .
2591+ * With no block given, returns a new Enumerator .
25882592 *
2589- * Returns a new Enumerator if no block given:
2590- * h = {foo: 0, bar: 1, baz: 2}
2591- * e = h.reject! # => #<Enumerator: {foo: 0, bar: 1, baz: 2}:reject!>
2592- * e.each {|key, value| key.start_with?('b') } # => {foo: 0}
2593+ * Related: see {Methods for Deleting}[rdoc-ref:Hash@Methods+for+Deleting].
25932594 */
25942595
25952596static VALUE
You can’t perform that action at this time.
0 commit comments