Class: Prawn::SwissQRBill::CuttingLines

Inherits:
Object
  • Object
show all
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.expand_path("#{__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

Instance Method Summary collapse

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

#docObject (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_heightObject (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_widthObject (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

#drawObject



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