From: Andrea Reginato Date: 2006-02-02T00:54:57+09:00 Subject: YAML-ing classes and modules in 1.8.4 -- Was: Re: Extend an Joel VanderWerf wrote: > Joel VanderWerf wrote: >> I had some code to serialize module and class identities (without any of >> their instance variables or class variables, though) with 1.8.2 (see >> below) but it seems not to work with 1.8.4. I will take a look at it >> later today. > > Here's a version for 1.8.4. Are you listening, _why, and is there a > chance of putting this in the YAML lib? > I will try in the next days. > ---------------------------------- > Sample code: > ---------------------------------- > yy = [Enumerable, Comparable, String, File].to_yaml > puts yy > p YAML.load(yy) > > ---------------------------------- > Output: > ---------------------------------- > --- > - !ruby/module Enumerable > - !ruby/module Comparable > - !ruby/class String > - !ruby/class File > [Enumerable, Comparable, String, File] Thanks for the answer. --Reis -- Posted via http://www.ruby-forum.com/.