Slide 47
Slide 47 text
def deprewrite(method_name, to:, from: nil)
class_eval do
old = "_deprecated_
#{
method_name}"
alias_method old, method_name
define_method method_name do |*args, &block|
filepath, line = Gem.location_of_caller
source = File.read(filepath)
# Transformation logic here
send old, *args, &block
end
end
end
%FQSFXSJUFS3VCZ*NQMFNFOUBUJPO%FUBJMT
(FU
fi
MFQBUIBOESFBEUIF
fi
MFUPEFUFDUBDBMMTJUF
)PXUPUSBOTGPSNDPEF
2