How do I get the following to happen: I want to change the value of an array element which is being referenced between pipe characters in a .each loop.
.each
How about simply:
x = %w(hello there world).map! { |e| e == "hello" ? "hi" : e }