Class: SirTracksAlot::Reports::TargetReport

Inherits:
SirTracksAlotReport show all
Defined in:
lib/sir_tracks_alot/reports/target_report.rb

Defined Under Namespace

Modules: Helpers Classes: HTML

Constant Summary collapse

COLUMN_NAMES =
['target', 'page views', 'visits']

Instance Attribute Summary

Attributes inherited from SirTracksAlotReport

#all

Attributes inherited from Report

#all

Instance Method Summary collapse

Methods inherited from Report

build_rows

Instance Method Details

#setupObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/sir_tracks_alot/reports/target_report.rb', line 8

def setup
  super
  column_names = options.column_names || COLUMN_NAMES
  rows = options.rows || []
  
  table = Table(column_names, :data => rows)
  table.sort_rows_by!('page views', :order => :descending)
  
  self.data = table
end