class Deprecation
Ruby on Rails 8.0.5.1
Since v4.0.13Active Support Deprecation
Deprecation specifies the API used by Rails to deprecate methods, instance variables, objects, and constants. It’s also available for gems or applications.
For a gem, use Deprecation.new to create a Deprecation object and store it in your module or class (in order for users to be able to configure it).
module MyLibrary
def self.deprecator
@deprecator ||= ActiveSupport::Deprecation.new("2.0", "MyLibrary")
end
end
For a Railtie or Engine, you may also want to add it to the application’s deprecators, so that the application’s configuration can be applied to it.
module MyLibrary
class Railtie < Rails::Railtie
initializer "my_library.deprecator" do |app|
app.deprecators[:my_library] = MyLibrary.deprecator
end
end
end
With the above initializer, configuration settings like the following will affect MyLibrary.deprecator:
# in config/environments/test.rb
config.active_support.deprecation = :raise
Inherits from
Namespace
Modules
- ActiveSupport::Deprecation::Behavior
- ActiveSupport::Deprecation::DeprecatedConstantAccessor
- ActiveSupport::Deprecation::Disallowed
- ActiveSupport::Deprecation::MethodWrapper
- ActiveSupport::Deprecation::Reporting
Classes
Includes
Constants
Attributes
Methods (defined here)
- self. new
Methods (inherited)
From ActiveSupport::Deprecation::Behavior
(4)
From ActiveSupport::Deprecation::Disallowed
(1)
From ActiveSupport::Deprecation::MethodWrapper
(1)
From ActiveSupport::Deprecation::Reporting
(5)
- # allow
- # deprecation_warning
- # silence
- # silenced
- # warn
From Object
(17)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # with
- # with_options
From ActiveSupport::NumericWithFormat
(2)
- # to_formatted_s
- # to_fs