Sign up Login
home | you | technology | web 2.0 | podcasts | entertainment | photos | comics | videos
 
Latest from concentration studios - Home
 

Marshal Me!

Thursday, March 22, 2007

Marshal

Ruby makes object serialization super easy, right out of the box, in the core library, don't even have to require it, easy. Ruby gives us a super simple module called Marshal. A lot of objects are marshallable (but some are not, so watch out). Lets take a simple class.

1
2
3
4
5
6
7
8
9

class Show
  attr_accessor :name, :director, :author  

  def initialize(hash)
    ...

Original article from http://concentrationstudios.com/2007/3/22/serialization-is-fun
Login to read full articles and enjoy our free features for members.
« Enumerable: Saving Your Life, One Array at a Time
MinneBar 07 »
 

Related articles