From 0191af389373b0c534788799d977d3caae8a30d6 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 12 Jun 2020 11:40:54 -0400 Subject: [PATCH] Updated documentation and code so output is as expected. https://github.com/documenting-ruby/ruby/issues/93 This is one possible solution. Please look at the ticket for more. Thank you. --- enum.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/enum.c b/enum.c index 70267a07ddc2..309de465f9d4 100644 --- a/enum.c +++ b/enum.c @@ -2841,13 +2841,12 @@ chunk_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator)) * The following example counts words for each initial letter. * * open("/usr/share/dict/words", "r:iso-8859-1") { |f| - * f.chunk { |line| line.ord }.each { |ch, lines| p [ch.chr, lines.length] } + * f.chunk { |line| line.upcase.ord }.each { |ch, lines| p [ch.chr, lines.length] } * } - * #=> ["\n", 1] - * # ["A", 1327] - * # ["B", 1372] - * # ["C", 1507] - * # ["D", 791] + * #=> ["A", 17096] + * # ["B", 11070] + * # ["C", 19901] + * # ["D", 10896] * # ... * * The following key values have special meaning: