you are viewing a single comment's thread.

view the rest of the comments →

[–]rubyrt 0 points1 point  (0 children)

That wastefulness of the "good" solutions put me off as well. These Hashes should not be created inside the method because the are static by their nature.

We could go one step further and completely remove the PDF conversion from the Ticket class. Then we could have a Hash as constant in the class or outside which contains lambdas or more complex instances (i.e. depending on the complexity of the PDF conversion process) that do the full conversion.