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
4 5 6 |
# File 'lib/prawn/markup/processor/blocks.rb', line 4 def self.prepended(base) base.known_elements.push('p', 'br', 'div', 'hr') end |
Instance Method Details
#end_div ⇒ Object
29 30 31 |
# File 'lib/prawn/markup/processor/blocks.rb', line 29 def end_div handle_text_element end |
#end_document ⇒ Object
43 44 45 |
# File 'lib/prawn/markup/processor/blocks.rb', line 43 def end_document add_current_text end |
#end_p ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/prawn/markup/processor/blocks.rb', line 16 def end_p if inside_container? append_new_line append_text("\n") else add_paragraph end end |
#start_br ⇒ Object
8 9 10 |
# File 'lib/prawn/markup/processor/blocks.rb', line 8 def start_br append_text("\n") end |
#start_div ⇒ Object
25 26 27 |
# File 'lib/prawn/markup/processor/blocks.rb', line 25 def start_div handle_text_element end |
#start_hr ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/prawn/markup/processor/blocks.rb', line 33 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
12 13 14 |
# File 'lib/prawn/markup/processor/blocks.rb', line 12 def start_p handle_text_element end |