1. Technology
Send to a Friend via Email

Serialization Methods in Ruby

Serializing an object is to convert an object to a byte stream and either store that object for future loading, or sending to another program to be loaded there.

Serialization in Ruby: Marshal
Serializing an object is to convert an object to a byte stream and either store that object for future loading, or sending to another program to be loaded there. There are several common ways to serialize objects in Ruby. The Marshal module is used less often than the other methods, but it's included in the standard library.

Serialization in Ruby: YAML
YAML (YAML Ain't Markup Language) is perhaps the most common form of serialization in Ruby applications. It's used for configuration files in Rails and other projects, and is nearly ubiquitous. It also has distinct advantages over marshal, and is usually preferred.

You can opt-out at any time. Please refer to our privacy policy for contact information.

©2014 About.com. All rights reserved.