L
Lyle Johnson
Suppose I have a method that will yield to a block if one is given:
def try(x, y, z)
# ... do some other stuff first ...
yield self if block_given?
end
Now suppose that I create an alias to this method, for the purpose of
overriding how it's called, e.g.
alias old_try try
def try(hash)
old_try(hash[:x], hash[:y], hash[:z])
end
If someone calls this new and improved version of try() and provides a
block, is there any way for me to somehow pass that block down into
old_try() without actually modifying the method signature?
def try(x, y, z)
# ... do some other stuff first ...
yield self if block_given?
end
Now suppose that I create an alias to this method, for the purpose of
overriding how it's called, e.g.
alias old_try try
def try(hash)
old_try(hash[:x], hash[:y], hash[:z])
end
If someone calls this new and improved version of try() and provides a
block, is there any way for me to somehow pass that block down into
old_try() without actually modifying the method signature?