Johnathon Wright <jw / mustmodify.com> 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. 
   (AndrBreton)