From: Ola Bini Date: 2008-11-26T18:31:46+09:00 Subject: Re: Exclude members from YAML conversion? Christian Kerth wrote: > Hi! > > I have the following class: > > class user > > attr_accessor :userid, :username > > def initialize > @userid = "" > @username = "" > > @prefix = false > @unprefix = false > end > > end > > when i convert that with to_yaml, all 4 member variables are translated > into the yaml string. I need to exclude the members @prefix and > @unprefix, they are used just for internal decisions and dosn't need to > be in the yaml string. > > how do i do that? > You can override yaml_properties to return only the ones you want to be in the yaml string. Cheers -- Ola Bini (http://olabini.com) JRuby Core Developer Developer, ThoughtWorks Studios (http://studios.thoughtworks.com) Practical JRuby on Rails (http://apress.com/book/view/9781590598818) "Yields falsehood when quined" yields falsehood when quined.