Class: PrawnHtml::Callbacks::StrikeThrough
- Inherits:
-
Object
- Object
- PrawnHtml::Callbacks::StrikeThrough
- Defined in:
- lib/prawn_html/callbacks/strike_through.rb
Instance Method Summary collapse
-
#initialize(pdf, _item) ⇒ StrikeThrough
constructor
A new instance of StrikeThrough.
- #render_in_front(fragment) ⇒ Object
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 |