I want to take a list of links and split them with alternating joins.
Here's what I have:
ruby-1.9.2-p290 :011 > tmp = [1,2,3,4,5,6].map(&:to_s)
=> ["1", "2", "3", "4", "5", "6"]
ruby-1.9.2-p290 :012 > tmp2 = []
=> []
ruby-1.9.2-p290 :013 > tmp.each_slice(2) {|a| tmp2 << a.join("\t")}
=> nil
ruby-1.9.2-p290 :014 > tmp2.join("<br\>")
=> "1\t2<br>3\t4<br>5\t6"
Is there a way to do this in a single line? I know I can do it with a Proc or a block call, but I am hoping for something cleaner. It seems like there is always some Array or Enumerable method I've yet to learn about, but I haven't found anything yet.
mapmethod in :013?