Class: Booky::Layout::Base::Outline
- Includes:
- Helpers
- Defined in:
- lib/booky/layout/base/outline.rb
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
#to_prawn ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/booky/layout/base/outline.rb', line 5 def to_prawn outline.define do toc = Booky::Layout.config.toc toc.each do |entry| if entry[:parent].empty? section entry[:name], :destination => entry[:page] else add_subsection_to entry[:parent] do section entry[:name], :destination => entry[:page] end end end end end |