jimweirich/builder — pull request #13 by barttenbrinke (2011-11-16 09:43:06+00:00)
Title: Added method caching to XmlBuilder instances

Hello,
first of all: I really love the xml builder. The interface is clean and the implementation is simple and clean.
There were however two things that I felt that needed some improvement:

- First commit: Moved all logic from method_missing to tag! function. As stated in the original comments on the method_missing: "method_missing should never be called directly" and it also should not have complex logic in it. This commit addresses this.

- Second commit: This commit dynamically creates any method missed as an instance method on the XMLBuilder instance object. Because XML documents are usually very repetitive in nature, the next node will be handled by the new method instead of method_missing. As method_missing is very slow, this speeds up document generation significantly.

Greetings, Bart ten Brinke