Kain Nobel
Member
Is there a certain way to alias a method with a 'loop do' command, especially a 'loop do' with 'if' and 'else' statements in it? Basically, I'm editing a script that copies and re-writes 3 or 4 default scripts, with additional information added into the methods.
I've prettymuch got alias_method down, but if you're trying to modify a 'loop do' with an alias method, how do you do it?
I've prettymuch got alias_method down, but if you're trying to modify a 'loop do' with an alias method, how do you do it?
Code:
def method
# Some code before the loop
loop do
if @somecode == 1
# Do Something 1
elsif @somecode == 2
# Do Something 2
else
# Do Something 3 (Added to the method)
end
end
end