класс ActiveSupport::Deprecation::DeprecatedObjectProxy
Этот DeprecatedObjectProxy преобразует объект в устаревший объект.
@old_object = DeprecatedObjectProxy.new(Object.new, "Don't use this object anymore!") @old_object = DeprecatedObjectProxy.new(Object.new, "Don't use this object anymore!", deprecator_instance)
Когда кто-то выполняет любой метод, кроме inspect, на объекте-прокси, это вызовет метод warn на deprecator_instance.
По умолчанию используется ActiveSupport::Deprecation
Публичные методы класса
# File activesupport/lib/active_support/deprecation/proxy_wrappers.rb, line 38 def initialize(object, message, deprecator = ActiveSupport::Deprecation.instance) @object = object @message = message @deprecator = deprecator end
© 2004–2018 David Heinemeier Hansson
Licensed under the MIT License.