Class: FileViewStat
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- FileViewStat
- Extended by:
- Sufia::FileStatUtils
- Defined in:
- app/models/file_view_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 17 |
# File 'app/models/file_view_stat.rb', line 14 def self.ga_statistics start_date, file_id path = Sufia::Engine.routes.url_helpers.generic_file_path(Sufia::Noid.noidify(file_id)) Sufia::Analytics.profile.sufia__pageview(sort: 'date', start_date: start_date).for_path(path) end |
.statistics(file_id, start_date) ⇒ Object
8 9 10 |
# File 'app/models/file_view_stat.rb', line 8 def self.statistics file_id, start_date combined_stats file_id, start_date, :views, :pageviews end |
Instance Method Details
#to_flot ⇒ Object
4 5 6 |
# File 'app/models/file_view_stat.rb', line 4 def to_flot [ self.class.convert_date(date), views ] end |