Sure.
page1 = lambda { |pdf|
# ...
}
if some_condition
page1[pdf]
else
#...
end
You can also use ordinary methods for this.
A pattern I like to use is:
class MyDocument < Prawn::Document
# whatever helpers
end
MyDocument.generate("foo.pdf") { |pdf| ... }