Sometimes it is not possible to add a method-hash to the DM Serializer,
for instance when you want to serialize an array of Resources. To
overcome these problems a #serialization_callback method can be defined
on a Resource, which will be called by the serializer. This method
should return a Hash (an exception will be raised otherwise) and the
keys and values will be serialized as well.