Class: DelayedDeprecation
- Inherits:
-
Object
- Object
- DelayedDeprecation
- Includes:
- ActiveSupport::Deprecation::Reporting
- Defined in:
- lib/delayed_deprecation.rb,
lib/delayed_deprecation/version.rb
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Attribute Summary collapse
-
#deprecation_horizon ⇒ Object
readonly
Returns the value of attribute deprecation_horizon.
Instance Method Summary collapse
- #behavior ⇒ Object
-
#initialize(reason, owner:, reconsider_after: nil, &block) ⇒ DelayedDeprecation
constructor
A new instance of DelayedDeprecation.
Constructor Details
#initialize(reason, owner:, reconsider_after: nil, &block) ⇒ DelayedDeprecation
Returns a new instance of DelayedDeprecation.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/delayed_deprecation.rb', line 8 def initialize(reason, owner:, reconsider_after: nil, &block) @reason = reason @owner = owner @reconsider_after = reconsider_after @deprecation_horizon = reconsider_after yield if block warn() if active? end |
Instance Attribute Details
#deprecation_horizon ⇒ Object (readonly)
Returns the value of attribute deprecation_horizon.
23 24 25 |
# File 'lib/delayed_deprecation.rb', line 23 def deprecation_horizon @deprecation_horizon end |
Instance Method Details
#behavior ⇒ Object
19 20 21 |
# File 'lib/delayed_deprecation.rb', line 19 def behavior ActiveSupport::Deprecation.behavior end |