Simple block example returning nil #1289
-
I tried to use the simple block example from the documentation document = Prawn::Document.generate("hello.pdf") do
text "Hello World!"
end and I expected document to contain a document = Prawn::Document.new will return a Is this expected behaviour? Am I doing something wrong here? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I have found that is does correctly generate the file to |
Beta Was this translation helpful? Give feedback.
-
As you can see in the documentation you referenced, the return value is never used in the examples. Also, it doesn't say anywhere that the document instance is returned. The "Object" that is mentioned on the method definition line in the documentation as return value is probably just some Yard thing in that they always have to display something there. |
Beta Was this translation helpful? Give feedback.
As you can see in the documentation you referenced, the return value is never used in the examples. Also, it doesn't say anywhere that the document instance is returned.
The "Object" that is mentioned on the method definition line in the documentation as return value is probably just some Yard thing in that they always have to display something there.