ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy

class ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy

Parent:
ActiveSupport::Deprecation::DeprecationProxy

This DeprecatedInstanceVariableProxy transforms instance variable to deprecated instance variable.

class Example
  def initialize(deprecator)
    @request = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(self, :request, :@request, deprecator)
    @_request = :a_request
  end

  def request
    @_request
  end

  def old_request
    @request
  end
end

When someone execute any method on @request variable this will trigger warn method on deprecator_instance and will fetch @_request va