Class: Booky::Layout::Base::Title

Inherits:
Element
  • Object
show all
Includes:
Helpers
Defined in:
lib/booky/layout/base/title.rb

Constant Summary collapse

OPTIONS =
{
  :align => :center,
  :size => 24
}

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_prawnObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/booky/layout/base/title.rb', line 10

def to_prawn
  update_levels(0)
  add_to_toc(0, "Cover")
  
  Booky::Layout.config.has_cover = true
  
  move_down 6.cm
  text @options[:text], OPTIONS
  move_down 0.3.cm
end