Class: Report

Inherits:
Object
  • Object
show all
Defined in:
lib/report.rb,
lib/report/csv.rb,
lib/report/pdf.rb,
lib/report/body.rb,
lib/report/head.rb,
lib/report/xlsx.rb,
lib/report/table.rb,
lib/report/utils.rb,
lib/report/version.rb,
lib/report/body/row.rb,
lib/report/csv/table.rb,
lib/report/body/column.rb

Defined Under Namespace

Modules: Utils Classes: Body, Csv, Head, Pdf, Table, Xlsx

Constant Summary collapse

VERSION =
"0.1.1"

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.pdf_formatObject

Returns the value of attribute pdf_format.



19
20
21
# File 'lib/report.rb', line 19

def pdf_format
  @pdf_format
end

.tablesObject

Returns the value of attribute tables.



18
19
20
# File 'lib/report.rb', line 18

def tables
  @tables
end

.xlsx_formatObject

Returns the value of attribute xlsx_format.



20
21
22
# File 'lib/report.rb', line 20

def xlsx_format
  @xlsx_format
end

Class Method Details

.format_pdf(hsh) ⇒ Object



28
29
30
# File 'lib/report.rb', line 28

def format_pdf(hsh)
  self.pdf_format = hsh
end

.format_xlsx(&blk) ⇒ Object



32
33
34
# File 'lib/report.rb', line 32

def format_xlsx(&blk)
  self.xlsx_format = blk
end

.table(table_name, &blk) ⇒ Object



22
23
24
25
26
# File 'lib/report.rb', line 22

def table(table_name, &blk)
  t = Table.new table_name
  t.instance_eval(&blk)
  tables << t
end

Instance Method Details

#cleanupObject



54
55
56
57
58
# File 'lib/report.rb', line 54

def cleanup
  @csv.try :cleanup
  @xlsx.try :cleanup
  @pdf.try :cleanup
end

#csvObject



42
43
44
# File 'lib/report.rb', line 42

def csv
  @csv ||= Csv.new self
end

#pdfObject



50
51
52
# File 'lib/report.rb', line 50

def pdf
  @pdf ||= Pdf.new self
end

#xlsxObject



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

def xlsx
  @xlsx ||= Xlsx.new self
end