From: "Mauricio Fernández" Date: 2003-01-07T17:14:23+09:00 Subject: Re: attr_cast, one a small step for interface techniques On Tue, Jan 07, 2003 at 03:16:40PM +0900, Tom Sawyer wrote: > All fixed. new code. (ever so slight changes): > > alias attr_reader_basic attr_reader > alias attr_writer_basic attr_writer > alias attr_accessor_basic attr_accessor > > def attr_reader(*args) > if args.last.kind_of?(Hash) or args.last.kind_of?(Array) > attr_reader_with_cast(args.pop) > end > attr_reader_basic(*args) > end > > def attr_reader_with_cast(harg) > harg.each { |name, cast| What happens when harg is an Array? -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Q: What's the big deal about rm, I have been deleting stuff for years? And never lost anything.. oops! A: ... -- From the Frequently Unasked Questions