Sha256: 14d90f4a0f70010f3b834f33b4f35d00dcecd0580cacea6cc5c25f8a94a854a2
Contents?: true
Size: 421 Bytes
Versions: 9
Compression:
Stored size: 421 Bytes
Contents
# frozen_string_literal: true module LogAnalyser class Pageviews InvalidLogEntriesError = Class.new(StandardError) def self.for(entries = {}) new.generate_view_count(entries) rescue StandardError raise InvalidLogEntriesError end def generate_view_count(entries) entries .transform_values(&:size) .sort_by(&:last) .reverse .to_h end end end
Version data entries
9 entries across 9 versions & 1 rubygems