1.I can\'t find an elegant way to write this code:
if array.empty? # process empty array else array.each do |el| # process el end end
I think there is no much more elegant or readable way to write this. Any way to somehow combine an iteration with a condition will just result in blackboxed code, meaning: the condition will just most likely be hidden in an Array extension.
Array