something like this :

statistic_hash = {}

array.each do |hash|
    if(hash[:did_it_sell)
        if(statistic_hash.has_key? hash[:title]
            statistic_hash[hash[:title]] += 1
        else
            statistic_hash[hash[:title]]  = 0
        end
    end
end

and then you would have a statistic_hash containing as key a product 
name , and as value , the number of units sold. I'm not sure about how 
to calculate the statistics .

I'm a ruby newbie , so I hope this was helpful :)
-- 
Posted via http://www.ruby-forum.com/.