From: Glen Holcomb Date: 2007-09-06T01:40:10+09:00 Subject: Re: Method switching ------=_Part_26300_33409032.1189010402952 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Could you use a hash defined just outside the something methods? On 9/5/07, Lee Jarvis wrote: > > Ok this probably won't make any send at all, but lets say i have > something like this: > > def send(a) > puts "#{a}\n" > end > > def colorsend(a) > puts "#{colorize(a)}\n" > end > > def something > send "hello" > end > > > > Ok lets say i have 50+ methods like the something method, that relate to > the send method, i want to be able to have 1 switch to change the method > without changing every method that uses send(message) > for example i could use > > if @color = 1 > colorsend(msg) > else > send(msg) > end > > but that means i would have to add that to *every* method.. if anyone at > all out there understands what i mean it would be very helpful > > thanks in advance.. > -- > Posted via http://www.ruby-forum.com/. > > -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) ------=_Part_26300_33409032.1189010402952--