instance method []=

Ruby on Rails 7.2.3

Since v7.1.6

Available in: v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

[]=(name, deprecator)

Adds a given deprecator to this collection. The deprecator will be immediately configured with any options previously set on this collection.

deprecators = ActiveSupport::Deprecation::Deprecators.new
deprecators.debug = true

foo_deprecator = ActiveSupport::Deprecation.new("2.0", "Foo")
foo_deprecator.debug    # => false

deprecators[:foo] = foo_deprecator
deprecators[:foo].debug # => true
foo_deprecator.debug    # => true

Parameters

name req
deprecator req
Source
# File activesupport/lib/active_support/deprecation/deprecators.rb, line 34
      def []=(name, deprecator)
        apply_options(deprecator)
        @deprecators[name] = deprecator
      end

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

Defined in ActiveSupport::Deprecation::Deprecators

Type at least 2 characters to search.

↑↓ navigate · open · esc close