Class: Bookify::Node::Div

Inherits:
Base
  • Object
show all
Defined in:
lib/bookify/node/div.rb

Constant Summary

Constants inherited from Base

Base::FONTS

Instance Attribute Summary

Attributes inherited from Base

#node, #pdf

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

#renderObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/bookify/node/div.rb', line 5

def render
  html_classes = (node.attr(:class) || "").split(" ")

  if html_classes.include?("page-break")
    bounds.move_past_bottom

    until bounds.left == 0.0
      bounds.move_past_bottom
    end
  elsif html_classes.include?("section-break")
    bounds.move_past_bottom
  end
end