brew/Library/Homebrew/api/analytics.rb
Patrick Linnane 683a8aad99
Update analytics.rb
Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com>
2024-08-20 12:47:48 -07:00

23 lines
593 B
Ruby

# typed: strict
# frozen_string_literal: true
module Homebrew
module API
# Helper functions for using the analytics JSON API.
module Analytics
class << self
sig { returns(String) }
def analytics_api_path
"analytics"
end
alias generic_analytics_api_path analytics_api_path
sig { params(category: String, days: T.any(Integer, String)).returns(T::Hash[String, T.untyped]) }
def fetch(category, days)
Homebrew::API.fetch "#{analytics_api_path}/#{category}/#{days}d.json"
end
end
end
end
end