Class: Prawn::SwissQRBill::CuttingLines
- Inherits:
-
Object
- Object
- Prawn::SwissQRBill::CuttingLines
- Defined in:
- lib/prawn/swiss_qr_bill/cutting_lines.rb
Overview
Horizontal and vertical cutting lines with a scissor symbol
Constant Summary collapse
- SCISSOR_FILE =
File.("#{__dir__}/../../../assets/images/scissor.png")
- SCISSOR_WIDTH =
5.mm
- SCISSOR_HEIGHT =
3.mm
- PAD_LEFT =
5.mm
- PAD_TOP =
1.mm
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#receipt_height ⇒ Object
readonly
Returns the value of attribute receipt_height.
-
#receipt_width ⇒ Object
readonly
Returns the value of attribute receipt_width.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(document) ⇒ CuttingLines
constructor
A new instance of CuttingLines.
Constructor Details
#initialize(document) ⇒ CuttingLines
Returns a new instance of CuttingLines.
17 18 19 20 21 22 23 |
# File 'lib/prawn/swiss_qr_bill/cutting_lines.rb', line 17 def initialize(document) @doc = document @brain = { border: { color: nil, width: nil } } load_specs end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
15 16 17 |
# File 'lib/prawn/swiss_qr_bill/cutting_lines.rb', line 15 def doc @doc end |
#receipt_height ⇒ Object (readonly)
Returns the value of attribute receipt_height.
15 16 17 |
# File 'lib/prawn/swiss_qr_bill/cutting_lines.rb', line 15 def receipt_height @receipt_height end |
#receipt_width ⇒ Object (readonly)
Returns the value of attribute receipt_width.
15 16 17 |
# File 'lib/prawn/swiss_qr_bill/cutting_lines.rb', line 15 def receipt_width @receipt_width end |
Instance Method Details
#draw ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/prawn/swiss_qr_bill/cutting_lines.rb', line 25 def draw set_styles draw_strokes draw_scissors reset_styles end |