Class: Prawn::SwissQRBill::CornerBox

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

Overview

Draws a box with corner ticks

OPTIMIZE: rewrite @document to accessor, like the others

Constant Summary collapse

TICK_SIZE =
3.mm
LINE_WIDTH =
0.75

Instance Method Summary collapse

Constructor Details

#initialize(document, point, options) ⇒ CornerBox

Returns a new instance of CornerBox.



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/prawn/swiss_qr_bill/corner_box.rb', line 13

def initialize(document, point, options)
  unless options.key?(:width) && options.key?(:height)
    raise ArgumentError,
          'corner_box needs the :width and :height option to be set'
  end

  @document = document
  @point = point
  @width = options[:width]
  @height = options[:height]

  @brain = {}
end

Instance Method Details

#drawObject



27
28
29
30
31
# File 'lib/prawn/swiss_qr_bill/corner_box.rb', line 27

def draw
  set_styles
  draw_lines
  reset_styles
end