Class: Gambas::PdfCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/gambas.rb

Class Method Summary collapse

Class Method Details

.create(options = nil) {|pdf| ... } ⇒ Object

Yields:

  • (pdf)


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

def self.create (options = nil)
  pdf = pdf_document(options)
  yield pdf
  pdf.render.html_safe
end

.pdf_document(options = nil) ⇒ Object



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

def self.pdf_document (options = nil)
  _options = (Gambas.options || {}).merge(options || {})
  Prawn::Document.new(_options)
end