Class: Bookify::Node::Paragraph
- Defined in:
- lib/bookify/node/paragraph.rb
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
#render ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bookify/node/paragraph.rb', line 5 def render if node.children.all? { |c| c.name.to_sym == :img || c.text == "\n" } node.children.select { |c| c.name.to_sym == :img }.each do |img| SUBCLASSES[:img].render(img, pdf) end else = { inline_format: true, align: html_classes.include?("center") ? :center : :left } html = clean_html(node.inner_html.tr("\n", " ")) font :primary do text html, end move_down 10 end end |