[RESOLVED] Small Aliasing Question

Started by shdwlink1993, August 13, 2009, 05:34:00 pm

Previous topic - Next topic

shdwlink1993

August 13, 2009, 05:34:00 pm Last Edit: August 13, 2009, 11:40:32 pm by shdwlink1993
Unless I'm very mistaken, aliasing a definition in a module isn't quite as easy as the same in a class. Can anyone tell me what you need to do to alias in a module?

Thanks in advance
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

fugibo

Quote from: shdwlink1993 on August 13, 2009, 05:34:00 pm
Unless I'm very mistaken, aliasing a definition in a module isn't quite as easy as the same in a class. Can anyone tell me what you need to do to alias in a module?

Thanks in advance



class << self
  alias :newmethod :oldmethod
end

shdwlink1993

OK. Thanks very much, Longfellow. Cheerio.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."