Module: ReportBuilder

Defined in:
lib/report_builder.rb,
lib/report_builder/prisma_report.rb,
lib/report_builder/process_report.rb,
lib/report_builder/fulltext_report.rb,
lib/report_builder/process_report/excel.rb,
lib/report_builder/fulltext_report/excel.rb

Overview

Common interface to create reports.

On route ‘/review/:sr_id/report/:type/:format’ ReportBuilder is called with

@report=ReportBuilder.get_report(@sr,@type, self)

and self is the app sinatra object. Class to obtain report is obtained capitalizing type and adding ‘Report’ So, ‘fulltext’ instantiate a ReportBuilder::FullTextReport, with params sr and app.

If format is html, @report object will be sent to ‘/views/report/<type>.haml’ haml template.

If not, output will be called

Defined Under Namespace

Modules: ReportAbstract Classes: FullTextReport, FulltextReport, PrismaReport, ProcessReport

Class Method Summary collapse

Class Method Details

.get_report(sr, type, app) ⇒ Object



45
46
47
48
# File 'lib/report_builder.rb', line 45

def self.get_report(sr,type,app)
  klass="#{type.capitalize}Report".to_sym
  ReportBuilder.const_get(klass).send(:new, sr,app)
end