Module: Rolify::Utils

Included in:
Role
Defined in:
lib/rolify/utils.rb

Instance Method Summary collapse

Instance Method Details

#deprecate(old_method, new_method) ⇒ Object



3
4
5
6
7
8
# File 'lib/rolify/utils.rb', line 3

def deprecate(old_method, new_method)
  define_method(old_method) do |*args|
    warn "[DEPRECATION] #{caller.first}: `#{old_method}` is deprecated.  Please use `#{new_method}` instead."
    send(new_method, *args)
  end
end