Class: Prawn::SwissQRBill::Bill

Inherits:
Object
  • Object
show all
Defined in:
lib/prawn/swiss_qr_bill/bill.rb

Overview

Bill renders the Swiss QR-bill at the bottom of a page

Constant Summary collapse

FONT_DIR =
File.expand_path("#{__dir__}/../../../assets/fonts")

Instance Method Summary collapse

Constructor Details

#initialize(document, data, options = {}) ⇒ Bill

Returns a new instance of Bill.



9
10
11
12
13
# File 'lib/prawn/swiss_qr_bill/bill.rb', line 9

def initialize(document, data, options = {})
  @doc = document
  @data = data
  @options = options || {}
end

Instance Method Details

#drawObject



15
16
17
18
19
20
21
22
# File 'lib/prawn/swiss_qr_bill/bill.rb', line 15

def draw
  set_font

  @doc.canvas do
    Sections.draw_all(@doc, @data, @options)
    CuttingLines.new(@doc).draw
  end
end