Class: R2OAS::Deprecation

Inherits:
Object show all
Includes:
Behavior, InstanceDelegator, Reporting, Singleton
Defined in:
lib/r2-oas/support/deprecation.rb,
lib/r2-oas/support/deprecation/behavior.rb,
lib/r2-oas/support/deprecation/reporting.rb,
lib/r2-oas/support/deprecation/instance_delegator.rb

Defined Under Namespace

Modules: Behavior, InstanceDelegator, Reporting Classes: DeprecationError

Constant Summary collapse

DEFAULT_BEHAVIORS =
{
  stderr: lambda { |message, _callstack, _deprecation_horizon, _gem_name|
    $stderr.puts(message)
  }
}.freeze

Constants included from Reporting

Reporting::FILE_LINE_METHOD_REGEXP, Reporting::R2OAS_GEM_ROOT

Instance Attribute Summary collapse

Attributes included from Reporting

#gem_name, #silenced

Instance Method Summary collapse

Methods included from Reporting

#silence, #warn

Methods included from Behavior

#behavior

Methods included from InstanceDelegator

included

Constructor Details

#initialize(deprecation_horizon = '0.4.2', gem_name = 'r2-oas') ⇒ Deprecation

Returns a new instance of Deprecation.



20
21
22
23
24
# File 'lib/r2-oas/support/deprecation.rb', line 20

def initialize(deprecation_horizon = '0.4.2', gem_name = 'r2-oas')
  self.gem_name = gem_name
  self.deprecation_horizon = deprecation_horizon
  self.silenced = false
end

Instance Attribute Details

#deprecation_horizonObject

The version number in which the deprecated behavior will be removed, by default.



18
19
20
# File 'lib/r2-oas/support/deprecation.rb', line 18

def deprecation_horizon
  @deprecation_horizon
end