Class: PrawnHtml::Callbacks::StrikeThrough

Inherits:
Object
  • Object
show all
Defined in:
lib/prawn_html/callbacks/strike_through.rb

Instance Method Summary collapse

Constructor Details

#initialize(pdf, _item) ⇒ StrikeThrough

Returns a new instance of StrikeThrough.



6
7
8
# File 'lib/prawn_html/callbacks/strike_through.rb', line 6

def initialize(pdf, _item)
  @pdf = pdf
end

Instance Method Details

#render_in_front(fragment) ⇒ Object



10
11
12
13
14
15
# File 'lib/prawn_html/callbacks/strike_through.rb', line 10

def render_in_front(fragment)
  x1 = fragment.left
  x2 = fragment.right
  y = (fragment.top + fragment.bottom) / 2
  @pdf.underline(x1: x1, x2: x2, y: y)
end