Is it possible to, for example, override the ‘puts’ method and replace it with a function that calls ‘puts’ twice?
For example:
class IO
def puts str
puts str
puts str
end
end
I know this example is stupid but I need it for something else. Basically, I want to override a function but I want the overriding function to include calls to the original, overridden function.
1 Answer