Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
deprecated : (in refactory ruby ed.)
class Module
def deprecate(methodName, &block)
module_eval <<-END
alias_method :deprecated_#{methodName}, :#{methodName}
def #{methodName}(*args, &block)
$stderr.puts "Warning: calling deprecated method #{self}.#{methodName}."
deprecated_#{methodName}(*args, &block)
end
END
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.