Class: Invoicing::LedgerItem::PdfGenerator
- Inherits:
-
Object
- Object
- Invoicing::LedgerItem::PdfGenerator
- Defined in:
- lib/invoicing/ledger_item/pdf_generator.rb
Instance Attribute Summary collapse
-
#invoice ⇒ Object
readonly
Returns the value of attribute invoice.
Instance Method Summary collapse
-
#initialize(invoice) ⇒ PdfGenerator
constructor
A new instance of PdfGenerator.
- #render(file) ⇒ Object
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
#invoice ⇒ Object (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 |