[Ace]How do i alias self.method?

● ARCHIVED · READ-ONLY
Started by Gleen 4 posts View original ↗
  1. I need to alias an method inside BattleManager, but i'm stuck in an error saying that the original method don't exist. How should i alias self.method?



    Code:
    module BattleManager
      alias old_display_exp display_exp
      def display_exp
        old_display_exp
       ...
      end
    end
  2. Thanks.
  3. you can simply use



    Code:
    class << ModuleName
      alias :old_method :method
      def method # without self
        old_method
      end
    end