Class: TableData::Presenters::PDF

Inherits:
TableData::Presenter show all
Defined in:
lib/tabledata/presenters/pdf.rb

Instance Attribute Summary

Attributes inherited from TableData::Presenter

#table

Instance Method Summary collapse

Methods inherited from TableData::Presenter

#initialize, present

Constructor Details

This class inherits a constructor from TableData::Presenter

Instance Method Details

#documentObject



11
12
13
14
15
16
# File 'lib/tabledata/presenters/pdf.rb', line 11

def document
  pdf = Prawn::Document.new
  pdf.table @table.data

  pdf
end

#string(options = nil) ⇒ Object



18
19
20
# File 'lib/tabledata/presenters/pdf.rb', line 18

def string(options=nil)
  document.render
end

#write(path, options = nil) ⇒ Object



22
23
24
# File 'lib/tabledata/presenters/pdf.rb', line 22

def write(path, options=nil)
  document.render_file(path)
end