Created
May 31, 2018 07:31
-
-
Save mmyoji/fc2a1cd1b64881dcba9a0fc3dcd4f8ee to your computer and use it in GitHub Desktop.
Usage of Gem::Deprecate.deprecate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test | |
extend Gem::Deprecate | |
# DEPRECATED | |
def foo | |
puts "foo" | |
end | |
def bar | |
puts "bar" | |
end | |
deprecate :foo, :bar, 2018, 10 | |
end | |
t = Test.new | |
t.foo | |
#=> NOTE: Test#foo is deprecated; use bar instead. It will be removed on or after 2018-10-01. | |
# Test#foo called gem_deprecate.rb:16. | |
# foo | |
t.bar | |
#=> bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment