Class: CoAspects::Aspects::DeprecateAspect

Inherits:
Aspector::Base
  • Object
show all
Defined in:
lib/co_aspects/aspects/deprecate_aspect.rb

Overview

Generates a warning message saying that the method is deprecated and mentioning the new one.

Examples

class MyClass
  aspects_annotations!

  _deprecate use: :new_method
  def old_method
  end

  def new_method
  end

  _deprecate
  def deprecated_method
  end
end

MyClass.new.old_method
# => DEPRECATION WARNING: Target.old_method deprecated, use new_method instead.

MyClass.new.deprecated_method
# => DEPRECATION WARNING: Target.deprecated_method deprecated.