lib/delayed_deprecation.rb in delayed_deprecation-0.1.0 vs lib/delayed_deprecation.rb in delayed_deprecation-0.2.0
- old
+ new
@@ -7,18 +7,21 @@
def initialize(reason, owner:, reconsider_after: nil, &block)
@reason = reason
@owner = owner
@reconsider_after = reconsider_after
+ @deprecation_horizon = reconsider_after
yield if block
warn(message) if active?
end
def behavior
ActiveSupport::Deprecation.behavior
end
+
+ attr_reader :deprecation_horizon
private
def active?(date = Date.today)
!@reconsider_after || @reconsider_after <= date