From: James Edward Gray II Date: 2006-02-09T04:17:58+09:00 Subject: Re: Meta-Meta-Programming On Feb 8, 2006, at 1:11 PM, Daniel Nugent wrote: > My beef with the specific implementation in this thread as it applies > to Design By Contract is that you're issuing these wrapper methods > individually. > > A more preferential solution would involve setting up a list of > functions that need a contract applied and then being able to, in one > fell swoop, ensure that they all are bound to the contract at once, > whether that be preconditions, postconditions, or ensurances about the > parameters passed. Maybe that'll require a couple of method calls, > but you'd still generally be doing it all at once. class Example def one; ... end def two; ... end %w{one two}.each do |meth| apply_contract meth, ... end end James Edward Gray II