add unions to arrays in Ruby