Class: InvoiceBar::InvoicePDF

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TranslationHelper, InvoiceBarHelper
Defined in:
app/models/invoice_bar/invoice_pdf.rb

Instance Method Summary collapse

Methods included from InvoiceBarHelper

#active_for_controller, #formatted_amount, #formatted_money, #formatted_postcode

Constructor Details

#initialize(invoice) ⇒ InvoicePDF

Returns a new instance of InvoicePDF.



8
9
10
# File 'app/models/invoice_bar/invoice_pdf.rb', line 8

def initialize(invoice)
  @invoice = invoice
end

Instance Method Details

#renderObject



12
13
14
15
16
17
# File 'app/models/invoice_bar/invoice_pdf.rb', line 12

def render
  InvoicePrinter.render(
    document: printable_invoice,
    font: File.expand_path('app/assets/fonts/invoice_bar/Overpass_Regular.ttf', InvoiceBar::Engine.root)
  )
end