Kain Nobel
Member
Good day everybody!
I was just curious, because I try to do this and I get an error, but how do I alias a 'self.' method within a module? For instance...
module Optimize
 alias_method :kn_optimize_weapon_later, ptimize_weapon
 def self.optimize_weapon(*args)
  kn_optimize_weapon_later(*args)
  # ...
 end
end
Obviously I can always do it the standard way, but I get an error whenever I try to do it to 'self.' methods and I can't include 'self.' in the alias_method itself because it turns into a symbol and raises a syntax error.
I was just curious, because I try to do this and I get an error, but how do I alias a 'self.' method within a module? For instance...
module Optimize
 alias_method :kn_optimize_weapon_later, ptimize_weapon
 def self.optimize_weapon(*args)
  kn_optimize_weapon_later(*args)
  # ...
 end
end
Obviously I can always do it the standard way, but I get an error whenever I try to do it to 'self.' methods and I can't include 'self.' in the alias_method itself because it turns into a symbol and raises a syntax error.