From: Tom Sawyer Date: 2003-01-06T17:48:18+09:00 Subject: Re: attr_cast, one a small step for interface techniques On Sunday 05 January 2003 09:30 pm, Gavin Sinclair wrote: > Those both being annoyingly long, I would prefer an implementation > that allowed: > > attr_accessor :x, :y, :name => :to_s, :age => :to_i > > That is, :x and :y receive the normal attr_accessor treatment, while > > :name and :age get casting as well. > > You wouldn't be able to put "non-cast" arguments after "cast" > arguments, because, well, that's the way Ruby inline hash arguments > work, but that draws no complaint from me. yea, that works well. unless there's some unforseen wrong doing here i'll modify my code to work as you suggest. no need for another method at all! very nice. hmm..just occured to me, how will the code handle it if there are only hash arguments? in other words i'm not so sure what the methods args should be. suggestion? thanks, -transami