Module: Twitter::REST::API::Utils::ClassMethods

Defined in:
lib/twitter/rest/api/utils.rb

Instance Method Summary collapse

Instance Method Details

#deprecate_alias(new_name, old_name) ⇒ Object



20
21
22
23
24
25
# File 'lib/twitter/rest/api/utils.rb', line 20

def deprecate_alias(new_name, old_name)
  define_method(new_name) do |*args, &block|
    warn "#{Kernel.caller.first}: [DEPRECATION] ##{new_name} is deprecated. Use ##{old_name} instead."
    send(old_name, *args, &block)
  end
end