From: trans Date: 2009-06-28T18:51:05+09:00 Subject: Re: Attr Methods and object setters On Jun 27, 11:26 pm, Daniel DeLorme wrote: > Gregory Brown wrote: > > Anyway, here's a better way to solve the problem that probably > > addresses your concerns: > > > def name(*args) > >        return @name if args.empty? > >       @name = args.first > > end > > Another way to do this is to use some kind of singleton object > > Nothing = Object.new > def name(value = Nothing) >    @name = value unless value == Nothing >    @name > end def name(value = Exception) @name = value unless value == Exception @name end