A
Aaron Baldwin
I'm trying to alias a method at the point that method is defined.
Here is an example that results in the error: NameError: undefined
method 'foo' for class `Test'.
class Test
class << self
def singleton_method_added(m)
puts m
alias_method :bar, :foo
end
def foo
end
end
end
How can I call alias_method from within singleton_method_added and
access the singleton method?
Thanks,
Aaron
Here is an example that results in the error: NameError: undefined
method 'foo' for class `Test'.
class Test
class << self
def singleton_method_added(m)
puts m
alias_method :bar, :foo
end
def foo
end
end
end
How can I call alias_method from within singleton_method_added and
access the singleton method?
Thanks,
Aaron