Icedmetal57
Member
Hi, I've been trying lately to alias a particular type of method but didn't know the exact syntax for it, so basically all I've been doing is guessing. I need help aliasing a method like so...
I wasn't sure of how I would alias something like that. I've tried these different ways, but wasn't right, obviously, I wouldn't be posting this if they were.
If done this way, then I believe that the argument can't be adding to or subtracting from the original code, at least from what I understand.
Code:
def example=(n)
@n = n
end
I wasn't sure of how I would alias something like that. I've tried these different ways, but wasn't right, obviously, I wouldn't be posting this if they were.
Code:
alias old_example example
def example=(n)
old_example=(n)
@n = n
end
Code:
alias old_example example
def example=(n)
old_example(n)
@n = n
end
If done this way, then I believe that the argument can't be adding to or subtracting from the original code, at least from what I understand.
Code:
alias old_example example
def example=(n)
old_example = n
@n = n
end