class method self.deprecate_methods

Ruby on Rails 3.2.22.5

Since v3.0.20 Last seen in v3.2.22.5

Available in: v3.0.20 v3.1.12 v3.2.22.5

Signature

self.deprecate_methods(target_module, *method_names)

Declare that a method has been deprecated.

Parameters

target_module req
method_names rest
Source
# File activesupport/lib/active_support/deprecation/method_wrappers.rb, line 8
    def deprecate_methods(target_module, *method_names)
      options = method_names.extract_options!
      method_names += options.keys

      method_names.each do |method_name|
        target_module.alias_method_chain(method_name, :deprecation) do |target, punctuation|
          target_module.module_eval(<<-end_eval, __FILE__, __LINE__ + 1)
            def #{target}_with_deprecation#{punctuation}(*args, &block)
              ::ActiveSupport::Deprecation.warn(
                ::ActiveSupport::Deprecation.deprecated_method_warning(
                  :#{method_name},
                  #{options[method_name].inspect}),
                caller
              )
              send(:#{target}_without_deprecation#{punctuation}, *args, &block)
            end
          end_eval
        end
      end
    end

Defined in activesupport/lib/active_support/deprecation/method_wrappers.rb line 8 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::Deprecation

Type at least 2 characters to search.

↑↓ navigate · open · esc close