Ruby can take an object and convert it into stream of bytes that can be stored in database or can exposed outside of application. This is almost similer to Object Serialisation , which is very comman in java. In ruby , same process is called marshaling .
But there are two things need to be considered .
1. Some Objects cannot be dumped , if the objects to be dumped include bindings , procedure or methods objects , instance of class IO, singleton Object , or if you try to dump non-name classes or modules . (It will raise TypeError )
2. When you load marshaled object, Ruby needs to know the defination of class of that object.
very Common use case of Rails using marshaling is to store session data.