Class: Prawn::SwissQRBill::CornerBox
- Inherits:
-
Object
- Object
- Prawn::SwissQRBill::CornerBox
- 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
- #draw ⇒ Object
-
#initialize(document, point, options) ⇒ CornerBox
constructor
A new instance of CornerBox.
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, ) unless .key?(:width) && .key?(:height) raise ArgumentError, 'corner_box needs the :width and :height option to be set' end @document = document @point = point @width = [:width] @height = [:height] @brain = {} end |
Instance Method Details
#draw ⇒ Object
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 |