class test
def my_print
p "Print something"
end
end
class test
alias_method: old_print,: my_print
def my_print
old_print
p "Print some more"
end
end
My original test class is at the top. Then I decided to add some more, but I decided to make an alias.
But this suggests that my_print is already defined. Is there a short and easy way to check if a method to smooth a method is already defined?
source
share