File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2836,16 +2836,16 @@ rb_hash_select_bang(VALUE hash)
28362836 * keep_if {|key, value| ... } -> self
28372837 * keep_if -> new_enumerator
28382838 *
2839- * Calls the block for each key-value pair;
2839+ * With a block given, calls the block for each key-value pair;
28402840 * retains the entry if the block returns a truthy value;
2841- * otherwise deletes the entry; returns +self+.
2841+ * otherwise deletes the entry; returns +self+:
2842+ *
28422843 * h = {foo: 0, bar: 1, baz: 2}
28432844 * h.keep_if { |key, value| key.start_with?('b') } # => {bar: 1, baz: 2}
28442845 *
2845- * Returns a new Enumerator if no block given:
2846- * h = {foo: 0, bar: 1, baz: 2}
2847- * e = h.keep_if # => #<Enumerator: {foo: 0, bar: 1, baz: 2}:keep_if>
2848- * e.each { |key, value| key.start_with?('b') } # => {bar: 1, baz: 2}
2846+ * With no block given, returns a new Enumerator.
2847+ *
2848+ * Related: see {Methods for Deleting}[rdoc-ref:Hash@Methods+for+Deleting].
28492849 */
28502850
28512851static VALUE
You can’t perform that action at this time.
0 commit comments