класс ActiveSupport::Deprecation::DeprecatedConstantProxy
Этот DeprecatedConstantProxy преобразует константу в устаревшую константу.
OLD_CONST = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('OLD_CONST', 'NEW_CONST')
OLD_CONST = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('OLD_CONST', 'NEW_CONST', deprecator_instance)
Когда кто-то использует старую константу, это вызовет метод warn в deprecator_instance.
По умолчанию используется предупредитель ActiveSupport::Deprecation.
Публичные методы класса
# File activesupport/lib/active_support/deprecation/proxy_wrappers.rb, line 106 def initialize(old_const, new_const, deprecator = ActiveSupport::Deprecation.instance) @old_const = old_const @new_const = new_const @deprecator = deprecator end
Публичные методы экземпляра
# File activesupport/lib/active_support/deprecation/proxy_wrappers.rb, line 112 def class target.class end
© 2004–2018 David Heinemeier Hansson
Licensed under the MIT License.