Class: SirTracksAlot::Reports::ActorReport
- Inherits:
-
SirTracksAlotReport
- Object
- Ruport::Controller
- Report
- SirTracksAlotReport
- SirTracksAlot::Reports::ActorReport
- Defined in:
- lib/sir_tracks_alot/reports/actor_report.rb
Defined Under Namespace
Modules: Helpers Classes: HTML
Constant Summary collapse
- COLUMN_NAMES =
['actor', 'page views', 'visits']
Instance Attribute Summary
Attributes inherited from SirTracksAlotReport
Attributes inherited from Report
Instance Method Summary collapse
Methods inherited from Report
Instance Method Details
#setup ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sir_tracks_alot/reports/actor_report.rb', line 8 def setup super column_names = .column_names || COLUMN_NAMES counts = .counts || {} table = Table(column_names) do |t| counts.each do |count| t << [count.actor, count.visits, count.views] end end table.sort_rows_by!('page views', :order => :descending) self.data = table end |