Sha256: e4d367bb7989134ea5eb8222bf62bd859caf01d2f7e13aa03090d44601b65227
Contents?: true
Size: 929 Bytes
Versions: 12
Compression:
Stored size: 929 Bytes
Contents
module FHIR module DSTU2 # add support for deprecating instance and class methods module Deprecate def deprecate(old_method, new_method) if instance_methods.include? new_method define_method(old_method) do |*args, &block| message = "DEPRECATED: `#{old_method}` has been deprecated. Use `#{new_method}` instead. Called from #{caller.first}" FHIR::DSTU2.logger.warn message send(new_method, *args, &block) end end return unless methods.include? new_method (class << self; self; end).instance_eval do define_method(old_method) do |*args, &block| message = "DEPRECATED: `#{old_method}` has been deprecated. Use `#{new_method}` instead. Called from #{caller.first}" FHIR::DSTU2.logger.warn message send(new_method, *args, &block) end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems