Class: InvoiceBar::ReceiptPDF

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

Instance Method Summary collapse

Methods included from InvoiceBarHelper

#active_for_controller, #formatted_amount, #formatted_money, #formatted_postcode

Constructor Details

#initialize(receipt) ⇒ ReceiptPDF

Returns a new instance of ReceiptPDF.



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

def initialize(receipt)
  @receipt = receipt
end

Instance Method Details

#renderObject



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

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