summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-02-06 16:50:26 +0100
committerThom May <thom@chef.io>2018-02-12 17:36:16 +0000
commit5401a701f1e40f41e76ff855aa4c6dbf411dd230 (patch)
tree4b2fbedabbe5aeeb3bf942f3e86fa3b4edeafe2b /lib
parentd3031263eb7c5a31e8f20b4b54d33d184345ae45 (diff)
downloadchef-5401a701f1e40f41e76ff855aa4c6dbf411dd230.tar.gz
Add `introduced` property field
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/mixin/properties.rb1
-rw-r--r--lib/chef/property.rb12
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/chef/mixin/properties.rb b/lib/chef/mixin/properties.rb
index bb08f773da..6b95b87063 100644
--- a/lib/chef/mixin/properties.rb
+++ b/lib/chef/mixin/properties.rb
@@ -76,6 +76,7 @@ class Chef
# be run in the context of the instance (and able to access other
# properties).
# @option options [String] :description A description of the property.
+ # @option options [String] :introduced The release that introduced this property
# @option options [Boolean] :desired_state `true` if this property is
# part of desired state. Defaults to `true`.
# @option options [Boolean] :identity `true` if this property
diff --git a/lib/chef/property.rb b/lib/chef/property.rb
index 8ee9930c33..be54c8bfa1 100644
--- a/lib/chef/property.rb
+++ b/lib/chef/property.rb
@@ -65,6 +65,7 @@ class Chef
# tied to this property. Must include a leading `@`. Defaults to `@<name>`.
# `nil` means the property is opaque and not tied to a specific instance
# variable.
+ # @option options [String] :introduced The release that introduced this property
# @option options [Boolean] :desired_state `true` if this property is part of desired
# state. Defaults to `true`.
# @option options [Boolean] :identity `true` if this property is part of object
@@ -168,6 +169,15 @@ class Chef
end
#
+ # When this property was introduced
+ #
+ # @return [String]
+ #
+ def introduced
+ options[:introduced]
+ end
+
+ #
# The instance variable associated with this property.
#
# Defaults to `@<name>`
@@ -262,7 +272,7 @@ class Chef
#
def validation_options
@validation_options ||= options.reject do |k, v|
- [:declared_in, :name, :instance_variable_name, :desired_state, :identity, :default, :name_property, :coerce, :required, :nillable, :sensitive, :description].include?(k)
+ [:declared_in, :name, :instance_variable_name, :desired_state, :identity, :default, :name_property, :coerce, :required, :nillable, :sensitive, :description, :introduced].include?(k)
end
end