Class: Booky::Layout::Base::H3
- Includes:
- Helpers
- Defined in:
- lib/booky/layout/base/h3.rb
Constant Summary collapse
- OPTIONS =
{ :align => :left, :size => 14, :style => :italic }
Instance Attribute Summary
Attributes inherited from Element
#ast, #document, #index, #options
Instance Method Summary collapse
Methods included from Helpers
#add_to_toc, #is_first_rendering?, #update_levels
Methods inherited from Element
#initialize, #method_missing, #next_option, #previous_option
Constructor Details
This class inherits a constructor from Booky::Layout::Element
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Booky::Layout::Element
Instance Method Details
#start_new_page_if_needed ⇒ Object
11 12 13 |
# File 'lib/booky/layout/base/h3.rb', line 11 def start_new_page_if_needed start_new_page if cursor < (bounds.bottom + 4.cm) end |
#to_prawn ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/booky/layout/base/h3.rb', line 15 def to_prawn start_new_page_if_needed update_levels(3) add_to_toc(3) move_down 0.5.cm fill_color Booky::Layout::Base::COLORS[1] text @options[:text], OPTIONS fill_color Booky::Layout::Base::COLORS[0] move_down 0.5.cm end |