class AllocationStats::AllocationsProxy
def where(conditions)
- Example: select allocations of String objects: -
Parameters:
-
conditions
(Hash
) -- pairs of attribute names and values to be matched amongst allocations.
def where(conditions) @wheres << Proc.new do |allocations| conditions = conditions.inject({}) do |memo, pair| faux, value = *pair getter = attribute_getters([faux]).first memo.merge(getter => value) end allocations.select do |allocation| conditions.all? { |getter, value| getter.call(allocation) == value } end end self end