From: Daniel Sheppard Date: 2006-11-06T08:37:30+09:00 Subject: Re: Magic method instantiation > def class_extendor(*args) > args.each do |arg| > define_method(name) do |*args| > args.push(nil) if args.length == 1 > > args.push({}) if args.length == 2 > args.last['class'] ||= name if args.last.kind_of? Hash > super(*args) > end > end > end > > class_extendor "text_field_tag", "text_field_tag2" > > but it doesn't work (no wonders why...) I would guess because you're using the variable args twice - the fact that you've used it on the outside (as the parameter to your method) means that it has a wider scope. But without knowing what your expected output and actual output are, I can't be bothered trying to read your mind further.