Class: FileDownloadStat
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- FileDownloadStat
- Extended by:
- Sufia::FileStatUtils
- Defined in:
- app/models/file_download_stat.rb
Class Method Summary collapse
-
.ga_statistics(start_date, file_id) ⇒ Object
Sufia::Download is sent to Sufia::Analytics.profile as #sufia__download see Legato::ProfileMethods.method_name_from_klass.
- .statistics(file_id, start_date) ⇒ Object
Instance Method Summary collapse
Methods included from Sufia::FileStatUtils
Class Method Details
.ga_statistics(start_date, file_id) ⇒ Object
Sufia::Download is sent to Sufia::Analytics.profile as #sufia__download see Legato::ProfileMethods.method_name_from_klass
14 15 16 |
# File 'app/models/file_download_stat.rb', line 14 def self.ga_statistics start_date, file_id Sufia::Analytics.profile.sufia__download(sort: 'date', start_date: start_date, end_date: Date.yesterday).for_file(file_id) end |
.statistics(file_id, start_date) ⇒ Object
8 9 10 |
# File 'app/models/file_download_stat.rb', line 8 def self.statistics file_id, start_date combined_stats file_id, start_date, :downloads, :totalEvents end |
Instance Method Details
#to_flot ⇒ Object
4 5 6 |
# File 'app/models/file_download_stat.rb', line 4 def to_flot [ self.class.convert_date(date), downloads ] end |