Added serialization callbacks. #13

Open
wants to merge 1 commit into
from

Projects

None yet

1 participant

@jwkoelewijn

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.

@jwkoelewijn jwkoelewijn Added serialization callbacks.
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.
d495913
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment