The PrintJob::Transient adapter

One requirement I’ve had for a couple of projects recently is some kind of adapter allowing me to stream data straight to print without having to touch the file system.

Cups now has a Transient subclass of PrintJob which takes care of this tedium for us. Let’s use Prawn to illustrate the benefit:

I toyed with the idea of a proper adapter pattern, a C singleton method and this subclass. I’m not sure this is a perfect implementation, but developmentally it seems like the path of least resistance.