Class: Invoicing::LedgerItem::PdfGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/invoicing/ledger_item/pdf_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(invoice) ⇒ PdfGenerator

Returns a new instance of PdfGenerator


13
14
15
# File 'lib/invoicing/ledger_item/pdf_generator.rb', line 13

def initialize(invoice)
  @invoice = invoice
end

Instance Attribute Details

#invoiceObject (readonly)

Returns the value of attribute invoice


16
17
18
# File 'lib/invoicing/ledger_item/pdf_generator.rb', line 16

def invoice
  @invoice
end

Instance Method Details

#render(file) ⇒ Object


18
19
20
21
22
23
24
# File 'lib/invoicing/ledger_item/pdf_generator.rb', line 18

def render(file)
  Prawn::Document.generate(file) do |pdf|
    render_headers(pdf)
    render_details(pdf)
    render_summary(pdf)
  end
end