There is a drawback in “don’t mutate objects in ruby.”
Aleksei Matiushkin
21

Thanks for the response.

You a probably right about the memory consumption, but mutating a string feels so wrong to me. Even in Ruby :)

After looking at the example again, I think I would use a map and join if I was using this in a real Ruby project:

def concat_messages(items)
items
.select(&:ok?)
.map(&:message)
.join("")
end
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.