baalexander/node-xmlrpc — pull request #75 by patricklodder (2013-11-16 11:10:41+00:00)
Title: CustomType class implementation

As proposed by @baalexander in #63, this implements a ```CustomType``` class to be able to manipulate the serializer to generate xml in a certain way.

usage
-------
```javascript
var xmlrpc = require('xmlrpc');
var util = require('util');

// create your custom class
var YourType = function (raw) {
xmlrpc.CustomType.call(this, raw);
};

// inherit everything
util.inherits(YourType, xmlrpc.CustomType);

// set a custom tagName (defaults to 'customType')
YourType.prototype.tagName = 'YourType';

// optionally, override the serializer
YourType.prototype.serialize = function (xml) {
var value = somefunction(this.raw);
return xml.ele(this.tagName).txt(value);
}
```

test/serializer_test.js has been updated with method call and response tests for both the plain CustomType class and a derived class as a parameter.

I gave some thought to implementing something like ```xmlrpc.createCustomType(tagName, constr, serializer)``` but decided that this might be making things more obscure than they have to be, so I left that for now.