Sha256: bafe1448e9aee85188bd88c0daa36f3625a9cb8ca06f3dbe0025d29c810bebf7

Contents?: true

Size: 318 Bytes

Versions: 1

Compression:

Stored size: 318 Bytes

Contents

# frozen_string_literal: true

# calculate number of visits
class CalculateVisits
  def initialize(data)
    @data = data
  end

  def number_of_visits_pages
    hash_pages = Hash.new(0)
    @data.each do |page|
      hash_pages[page[:page]] += 1
    end
    hash_pages.sort_by { |_key, value| -value }.uniq
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
web_server_report-0.1.0 lib/web_server_report/calculate_visits.rb