Sha256: af1b9d565c451d495290f2af87cb4bc04909ba29e20344ce14126d07b7cb945f
Contents?: true
Size: 640 Bytes
Versions: 5
Compression:
Stored size: 640 Bytes
Contents
# Copyright 2018 Twitter, Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 module Twitter module TwitterText module Deprecation def deprecate(method, new_method = nil) deprecated_method = :"deprecated_#{method}" message = "Deprecation: `#{method}` is deprecated." message << " Please use `#{new_method}` instead." if new_method alias_method(deprecated_method, method) define_method method do |*args, &block| warn message unless $TESTING send(deprecated_method, *args, &block) end end end end end
Version data entries
5 entries across 5 versions & 4 rubygems