Module: Twitter::Deprecation
Instance Method Summary collapse
Instance Method Details
#deprecate(method, new_method = nil) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/twitter-text/deprecation.rb', line 3 def deprecate(method, new_method = nil) deprecated_method = :"deprecated_#{method}" = "Deprecation: `#{method}` is deprecated." << " Please use `#{new_method}` instead." if new_method alias_method(deprecated_method, method) define_method method do |*args, &block| warn send(deprecated_method, *args, &block) end end |