Class: Bookify::Node::H1
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#break_if_close_to_bottom, #clean_html, #decode_html, #font, #html_classes, #initialize, #method_missing, render
Constructor Details
This class inherits a constructor from Bookify::Node::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Bookify::Node::Base
Instance Method Details
#page_top ⇒ Object
13 14 15 |
# File 'lib/bookify/node/h1.rb', line 13 def page_top pdf.bounds.parent.height + 50 end |
#render ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/bookify/node/h1.rb', line 3 def render break_if_close_to_bottom(250) move_down 20 unless pdf.y == page_top font :h1 html = decode_html(node.inner_html.strip) outline.page title: html, destination: dest_xyz(0, pdf.y, nil, pdf.page) text html, align: :center move_down 10 end |