On Thu, Sep 11, 2008 at 11:43 AM, Alain m. Lafon <preek.aml / gmail.com> wrote: > Hi there, > > is there a way to include conditionals in something like: > > g.labels = Hash[*invoice.collect {|v| [v["Scandate"].to_s, > "1"]}.flatten] > > In this example I don't want to include entries to the hash where > v["Scandate"] is an empty string. > > Help is as always very much appreciated - thanks in advance, > Alain M. Lafon > -- > Posted via http://www.ruby-forum.com/. > > I sometimes decide against the map.select (or better select.map ) chaining using compact ary.map{ |x| c(x) && f(x) }.compact HTH Robert -- C'est vñÓitablement utile puisque c'est joli. Antoine de Saint ExupñÓy