Class: Chef::Deprecated::Base
- Inherits:
-
Object
- Object
- Chef::Deprecated::Base
- Defined in:
- lib/chef/deprecated.rb
Direct Known Subclasses
Attributes, ChefPlatformMethods, ChefRest, CustomResource, DeployResource, DnfPackageAllowDowngrade, EasyInstall, ErlResource, ExitCode, Generic, InternalApi, JsonAutoInflate, LaunchdHashProperty, LocalListen, MultiresourceMatch, NamespaceCollisions, PackageMisc, Property, PropertyNameCollision, RunCommand, SupportsProperty, UseInlineResources, VerifyFile
Constant Summary collapse
- BASE_URL =
"https://docs.chef.io/deprecations_"
Instance Attribute Summary collapse
-
#location ⇒ Object
Returns the value of attribute location.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#<<(location) ⇒ Object
We know that the only time this gets called is by Chef::Log.deprecation, so special case.
- #id ⇒ Object
-
#initialize(msg = nil, location = nil) ⇒ Base
constructor
A new instance of Base.
- #inspect ⇒ Object
- #link ⇒ Object
- #target ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(msg = nil, location = nil) ⇒ Base
Returns a new instance of Base.
37 38 39 40 |
# File 'lib/chef/deprecated.rb', line 37 def initialize(msg = nil, location = nil) @message = msg if msg @location = location if location end |
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location.
35 36 37 |
# File 'lib/chef/deprecated.rb', line 35 def location @location end |
#message ⇒ Object
Returns the value of attribute message.
35 36 37 |
# File 'lib/chef/deprecated.rb', line 35 def @message end |
Instance Method Details
#<<(location) ⇒ Object
We know that the only time this gets called is by Chef::Log.deprecation, so special case
52 53 54 |
# File 'lib/chef/deprecated.rb', line 52 def <<(location) @location = location end |
#id ⇒ Object
60 61 62 |
# File 'lib/chef/deprecated.rb', line 60 def id raise NotImplementedError, "subclasses of Chef::Deprecated::Base should define #id with a unique number" end |
#inspect ⇒ Object
56 57 58 |
# File 'lib/chef/deprecated.rb', line 56 def inspect "#{} (CHEF-#{id})#{location}.\n#{link}" end |
#link ⇒ Object
42 43 44 |
# File 'lib/chef/deprecated.rb', line 42 def link "Please see #{url} for further details and information on how to correct this problem." end |
#target ⇒ Object
64 65 66 |
# File 'lib/chef/deprecated.rb', line 64 def target raise NotImplementedError, "subclasses of Chef::Deprecated::Base should define #target" end |
#url ⇒ Object
46 47 48 |
# File 'lib/chef/deprecated.rb', line 46 def url "#{BASE_URL}#{target}" end |