# File lib/ice_cube/deprecated.rb, line 18 def deprecated(name, replacement) # Replace old method old_name = "#{name}_without_deprecation""#{name}_without_deprecation" alias_method old_name, name # And replace it with a wrapped version define_method(name) do |*args, &block| warn "IceCube: #{self.class}##{name} is deprecated (use #{replacement})", caller[0] send old_name, *args, &block end end