Module: Prawn::Markup::Processor::Blocks
- Included in:
- Prawn::Markup::Processor
- Defined in:
- lib/prawn/markup/processor/blocks.rb
Class Method Summary collapse
Instance Method Summary collapse
- #end_div ⇒ Object
- #end_document ⇒ Object
- #end_p ⇒ Object
- #start_br ⇒ Object
- #start_div ⇒ Object
- #start_hr ⇒ Object
- #start_p ⇒ Object
Class Method Details
.prepended(base) ⇒ Object
6 7 8 |
# File 'lib/prawn/markup/processor/blocks.rb', line 6 def self.prepended(base) base.known_elements.push('p', 'br', 'div', 'hr') end |
Instance Method Details
#end_div ⇒ Object
31 32 33 |
# File 'lib/prawn/markup/processor/blocks.rb', line 31 def end_div handle_text_element end |
#end_document ⇒ Object
45 46 47 |
# File 'lib/prawn/markup/processor/blocks.rb', line 45 def end_document add_current_text end |
#end_p ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/prawn/markup/processor/blocks.rb', line 18 def end_p if inside_container? append_new_line append_text("\n") else add_paragraph end end |
#start_br ⇒ Object
10 11 12 |
# File 'lib/prawn/markup/processor/blocks.rb', line 10 def start_br append_text("\n") end |
#start_div ⇒ Object
27 28 29 |
# File 'lib/prawn/markup/processor/blocks.rb', line 27 def start_div handle_text_element end |
#start_hr ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/prawn/markup/processor/blocks.rb', line 35 def start_hr return if inside_container? put_bottom_margin(nil) add_current_text pdf.move_down(hr_vertical_margin_top) pdf.stroke_horizontal_rule pdf.move_down(hr_vertical_margin_bottom) end |
#start_p ⇒ Object
14 15 16 |
# File 'lib/prawn/markup/processor/blocks.rb', line 14 def start_p handle_text_element end |