module Adhoq::Reporter
Public Class Methods
Source
# File lib/adhoq/reporter.rb, line 10 def generate(execution) executor = Executor.new(execution.raw_sql) reporter = lookup(execution.report_format).new(executor.execute) reporter.build_report end
Source
# File lib/adhoq/reporter.rb, line 17 def lookup(format) reporters[format.to_s] || raise(UnsupportedFormat) end
Source
# File lib/adhoq/reporter.rb, line 21 def supported_formats reporters.keys.sort end
Private Class Methods
Source
# File lib/adhoq/reporter.rb, line 27 def reporters @reporters ||= { 'csv' => Adhoq::Reporter::Csv, 'json' => Adhoq::Reporter::Json, 'xlsx' => Adhoq::Reporter::Xlsx, } end