I think I spotted a typo for each_char
each_char
The each_char method is essentially the each of strings. As its name suggests, it invokes its given block once for each character in the receiver string, passing that character as an argument. It returns its receiver.
like puts, print prints its argument, but it doesn’t insert a newline after printing
“alright alright alright”.each_char {|ch| print ch.upcase} #=> “alright alright alright”
The output for the one above should be ALRIGHT ALRIGHT ALRIGHT
note the difference when executed
“alright alright alright”.each_char {|ch| puts ch.upcase} #=> “alright alright alright”
The output for the one above should be
A
L
R
I
G
H
T
A
L
R
I
G
H
T
A
L
R
I
G
H
T