From: Jeff Wood Date: 2005-08-05T05:12:11+09:00 Subject: Re: interesting test tool... looking for opinions. The only thing I don't like about that solution is that you define the metadata outside the method body. I really think we should keep them together. Otherwise we're just asking for things to get out of sync. j. On 8/4/05, Alexandru Popescu wrote: > #: Phil Tomson changed the world a bit at a time by saying on 8/4/2005 9:16 PM :# > > In article <42F1BBE4.8020605@capitain.de>, > > Pit Capitain wrote: > >>Alexandru Popescu schrieb: > >>> Is there any metadata that can be associated with a method? I know it is > >>> an object, and maybe you can attach some metadata to it. From that point > >>> on the things will be more simple. > >> > >>No, you can't attach metadata to methods, but you can attach them to the > >>class or module where the methods are defined. I think this should be > >>enough for something like TestNG. For more info look into the archives > >>of ruby-talk or ruby-core (I don't remember where). > >> > > > > Why couldn't you add metadata to methods? > > > > class Metod > > def metadata > > @metadata > > end > > > > def metadata= data > > @metadata = data > > end > > end > > > > def foo > > "foo" > > end > > > > > > foometh = self.method(:foo) > > > > foometh.metadata = "This method just says foo" > > > > puts foometh.metadata #=> This method just says foo > > > > > > Phil > > > > > > > > > That was exactly what I have thought ... but haven't the means to express it. Thanks Phil. > > :alex |.::the_mindstorm::.| > > -- "So long, and thanks for all the fish" Jeff Wood