lib/allocation_stats/allocations_proxy.rb
# Group allocations by one or more attributes, that is, a list of symbols.
# Commonly, you might want to group allocations by:
#
# * :sourcefile, :sourceline, :class
# * :sourcefile, :method_id, :class
# * :classpath, :method_id, :class
#
# In this case, `:class` is the class of the allocated object (as opposed
# to `:classpath`, the classpath where the allocation occured).
Group allocations by one or more attributes, that is, a list of symbols.
Commonly, you might want to group allocations by.



In this case, `:class` is the class of the allocated object (as opposed
to `:classpath`, the classpath where the allocation occured).
Group allocations by one or more attributes that is a list of symbols . Commonly you might want to group allocations by . In this case ` : class ` is the class of the allocated object ( as opposed to ` : classpath ` the classpath where the allocation occured ) .
def group_by(*args)
      @group_keys = args
      @group_by = Proc.new do |allocations|
        getters = attribute_getters(@group_keys)
        allocations.group_by do |allocation|
          getters.map { |getter| getter.call(allocation) }
        end
      end
      self
    end
def group_by ( * args ) @group_keys = args @group_by = Proc . new do | allocations | getters = attribute_getters ( @group_keys ) allocations . group_by do | allocation | getters . map { | getter | getter . call ( allocation ) } end end self end
Group allocations by one or more attributes, that is, a list of symbols.
Group allocations by one or more attributes that is a list of symbols .
args
<not_specific>