Class: Renalware::Letters::Printing::RecipientAddressPagePdf

Inherits:
Object
  • Object
show all
Includes:
Prawn::View
Defined in:
app/pdfs/renalware/letters/printing/recipient_address_page_pdf.rb

Overview

Creates a letter addressee/recipient cover sheet PDF that will be inserted in front of each copy of the letter. Page 2 is always blank because we as are duplex printing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(recipient) ⇒ RecipientAddressPagePdf

Returns a new instance of RecipientAddressPagePdf.



14
15
16
17
# File 'app/pdfs/renalware/letters/printing/recipient_address_page_pdf.rb', line 14

def initialize(recipient)
  @recipient = recipient
  build
end

Instance Attribute Details

#recipientObject (readonly)

Returns the value of attribute recipient.



12
13
14
# File 'app/pdfs/renalware/letters/printing/recipient_address_page_pdf.rb', line 12

def recipient
  @recipient
end

Instance Method Details

#documentObject



19
20
21
22
23
24
25
26
# File 'app/pdfs/renalware/letters/printing/recipient_address_page_pdf.rb', line 19

def document
  @document ||= Prawn::Document.new(
    page_size: "A4",
    page_layout: :portrait,
    left_margin: 65,
    top_margin: 109
  )
end