mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
Use alias instead of alias_method within core classes
This commit is contained in:
parent
d401b1471d
commit
b447e8e33d
2 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
|||
#------------------------------------------------------------------------------
|
||||
class Class
|
||||
methods.grep(/instance_methods$/) do |name|
|
||||
alias_method :"original_#{name}", name
|
||||
alias :"original_#{name}" :"#{name}"
|
||||
define_method name do |*args|
|
||||
methods = self.send(:"original_#{name}", *args)
|
||||
methods.instance_variable_set('@__awesome_methods__', self) # Evil?!
|
||||
|
|
|
@ -7,7 +7,7 @@ class Object
|
|||
methods.grep(/methods$/) do |name|
|
||||
next if name.to_s.include? 'instance' # Instance methods are trapped in Class.
|
||||
|
||||
alias_method :"original_#{name}", name
|
||||
alias :"original_#{name}" :"#{name}"
|
||||
define_method name do |*args|
|
||||
methods = self.send(:"original_#{name}", *args)
|
||||
methods.instance_variable_set('@__awesome_methods__', self) # Evil?!
|
||||
|
|
Loading…
Reference in a new issue