Class: FileDownloadStat

Inherits:
Sufia::Statistic show all
Defined in:
app/models/file_download_stat.rb

Class Method Summary collapse

Methods inherited from Sufia::Statistic

build_for, convert_date, statistics, statistics_for, #to_flot, to_flots

Class Method Details

.filter(file) ⇒ Object



11
12
13
# File 'app/models/file_download_stat.rb', line 11

def self.filter(file)
  { file_id: file.id }
end

.ga_statistics(start_date, file) ⇒ Object

Sufia::Download is sent to Sufia::Analytics.profile as #sufia__download see Legato::ProfileMethods.method_name_from_klass



7
8
9
# File 'app/models/file_download_stat.rb', line 7

def self.ga_statistics(start_date, file)
  Sufia::Analytics.profile.sufia__download(sort: 'date', start_date: start_date, end_date: Date.yesterday).for_file(file.id)
end