Class: Array
Instance Method Summary collapse
Instance Method Details
#group_by(&block) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/ms/error_rate/qvalue.rb', line 6 def group_by(&block) hash = Hash.new {|h,k| h[k] = [] } each do |v| hash[block.call(v)] << v end hash end |