module SmartStats
  class IpCounter < Counter
    private

    def extract_key(value)
      value.to_s[/\b(?:\d{1,3}\.){3}\d{1,3}\b/]
    end
  end
end

{'avg_line_length': 15.2, 'max_line_length': 47, 'alphanum_fraction': 0.5921052631578947, 'licenses': ['MIT'], 'repository_name': 'tchorzewski1991/smartstats', 'path': 'lib/smartstats/ip_counter.rb', 'size': 152, 'lang': 'Ruby'}