Closed serra-allgood closed 10 years ago
The solution for this issue is to use the Prawn::Document.extensions
API as much as possible. In my own use case, I was able to extract much of the subclass to a module that's loaded with Prawn::Document.extensions << MyModule
inside an initializer for my Rails project. Due to the particularities of my use case, I still needed the subclass to inherit from Prawn::Document
, but the group
block no longer gets upset about those custom methods.
@corwinkelly Thanks for the update on this.
This particular use case involves a class inheriting from
Prawn::Document
. Because prawn-grouping creates a shallow copy of the document to test if the block spills over to a new context, the subclass's methods are not available in thegroup
block, resulting in aNoMethodError
if they're called inside of it.