Skip to content

Commit

Permalink
Fix render forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
bradgessler committed Feb 28, 2024
1 parent ee91e09 commit eb1d10f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/phlex/pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ def render(renderable, &block)
end

class << self
def document(document = Prawn::Document.new)
new.call(document)
document
def document(...)
Prawn::Document.new.tap do |document|
new(...).call(document)
end
end

def render(...)
Expand Down

0 comments on commit eb1d10f

Please sign in to comment.