summaryrefslogtreecommitdiff
path: root/lib/chef/property.rb
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/chef/property.rb
parentd3031263eb7c5a31e8f20b4b54d33d184345ae45 (diff)
downloadchef-5401a701f1e40f41e76ff855aa4c6dbf411dd230.tar.gz
Add `introduced` property field
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/property.rb')
-rw-r--r--lib/chef/property.rb12
1 files changed, 11 insertions, 1 deletions
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