From: brainopia Date: 2007-11-04T03:10:01+09:00 Subject: Re: defining methods dynamically > Exactly that was why I thaught of delegation, as I am not familiar > with the delegation idioms please forgive me that I handcoded it > > class Person > @roles = %w{ a b c d } > class << self; attr_reader :roles end > def method_missing name,*args,&blk > super unless @roles.map.to_s.include? name > ### do delegation here > @some_obj.send name, *args, &blk > end method_missing - is awfully slow, so if there is other option (like two from Dan Yoder) than better to use them at the cost of a few more lines.