Sha256: 2047fd8d4c206f4006770d066df5503de3cea75a9241e635fa3dfa789a43776f
Contents?: true
Size: 449 Bytes
Versions: 2
Compression:
Stored size: 449 Bytes
Contents
module Incollege 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 send(deprecated_method, *args, &block) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
incollege-text-1.12.1 | lib/incollege-text/deprecation.rb |
incollege-text-1.12.0 | lib/incollege-text/deprecation.rb |