From: unbewusst.sein@... (=?ISO-8859-1?Q?Une_B=E9vue?=) Date: 2010-05-21T02:30:04+09:00 Subject: Re: class best way for getters ? Johnathon Wright wrote: > I wrote a gem to handle this kind of situation... have a look at > http://valuable.mustmodify.com/ > > class HFSFile < Valuable > has_value :name > end > > would create a getter, setter, and accept an attributes hash like... > > HFSFile.new(:name => 'fu') > > or just > > file = HFSFile.new > >> file.name > => nil > > unless you want to specify a default... > > class HFSFile < Valuable > has_value :name, :default => 'anything' > end > > >> file = HSFile.new > >> file.name > => 'anything' fine, thanks a lot, it was what i was looking for ! -- � L'amour, c'est quand on rencontre quelqu'un qui vous donne de vos nouvelles. � (Andr� Breton)