Method: Prawn::Document#repeat
- Defined in:
- lib/prawn/repeater.rb
#repeat(page_filter, options = {}, &block) ⇒ void
This method returns an undefined value.
Provides a way to execute a block of code repeatedly based on a page_filter. Since Stamp is used under the hood, this method is very space efficient.
Also accepts an optional second argument for dynamic content which executes the code in the context of the filtered pages without using a Stamp.
77 78 79 80 81 82 |
# File 'lib/prawn/repeater.rb', line 77 def repeat(page_filter, = {}, &block) dynamic = .fetch(:dynamic, false) repeaters << Prawn::Repeater.new( self, page_filter, dynamic, &block ) end |