Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Added serialization callbacks. #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jwkoelewijn
Copy link

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.

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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant