Module: Liquid::Simplero::GroupingFilters

Included in:
Filters
Defined in:
app/models/liquid/simplero/grouping_filters.rb

Instance Method Summary collapse

Instance Method Details

#group_by(input, property) ⇒ Object

Group an array of items by a property

input - the inputted Enumerable property - the property

Returns an array of Hashes, each looking something like this:

{"name"  => "larry"
 "items" => [...] } # all the items where `property` == "larry"