Sha256: 366b6c19ac1f380a123db3e1e760bfd2584b81a7c20da93cdbd81a647c3f5d42
Contents?: true
Size: 731 Bytes
Versions: 49
Compression:
Stored size: 731 Bytes
Contents
module RailsPerformance module Models class Collection attr_reader :data def initialize @data = [] end def add(record) @data << record end def group_by(type) case type when :controller_action, :controller_action_format, :datetime, :path fetch_values @data.group_by(&type) else {} end end def fetch_values(groupped_collection) result = {} groupped_collection.each do |key, records| result[key] ||= [] records.each do |record| result[key] << record.value end end result end end end end
Version data entries
49 entries across 49 versions & 1 rubygems