8000 [DOC] Tweaks for Hash#each_value · github/ruby@fd134cf · GitHub
[go: up one dir, main page]

Skip to content

Commit fd134cf

Browse files
BurdetteLamarpeterzhu2118
authored andcommitted
[DOC] Tweaks for Hash#each_value
1 parent eafcdc1 commit fd134cf

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

hash.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3039,23 +3039,19 @@ each_value_i(VALUE key, VALUE value, VALUE _)
30393039
* each_value {|value| ... } -> self
30403040
* each_value -> new_enumerator
30413041
*
3042-
* Calls the given block with each value; returns +self+:
3042+
* With a block given, calls the block with each value; returns +self+:
3043+
*
30433044
* h = {foo: 0, bar: 1, baz: 2}
30443045
* h.each_value {|value| puts value } # => {foo: 0, bar: 1, baz: 2}
3045-
* Output:
3046-
* 0
3047-
* 1
3048-
* 2
30493046
*
3050-
* Returns a new Enumerator if no block given:
3051-
* h = {foo: 0, bar: 1, baz: 2}
3052-
* e = h.each_value # => #<Enumerator: {foo: 0, bar: 1, baz: 2}:each_value>
3053-
* h1 = e.each {|value| puts value }
3054-
* h1 # => {foo: 0, bar: 1, baz: 2}
30553047
* Output:
30563048
* 0
30573049
* 1
30583050
* 2
3051+
*
3052+
* With no block given, returns a new Enumerator.
3053+
*
3054+
* Related: see {Methods for Iterating}[rdoc-ref:Hash@Methods+for+Iterating].
30593055
*/
30603056

30613057
static VALUE

0 commit comments

Comments
 (0)
0