summaryrefslogtreecommitdiff
path: root/lib/chef/property.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-01-31 18:22:29 +0000
committerThom May <thom@chef.io>2018-02-12 17:36:12 +0000
commitd3031263eb7c5a31e8f20b4b54d33d184345ae45 (patch)
tree00f02c928cb240b9ee1be8b65e2fe19f823dad94 /lib/chef/property.rb
parenta7d56100275045ad44e57386aad86e463788ee85 (diff)
downloadchef-d3031263eb7c5a31e8f20b4b54d33d184345ae45.tar.gz
properties can have descriptions
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 9d0957dcdf..8ee9930c33 100644
--- a/lib/chef/property.rb
+++ b/lib/chef/property.rb
@@ -60,6 +60,7 @@ class Chef
# options).
# @option options [Symbol] :name The name of this property.
# @option options [Class] :declared_in The class this property comes from.
+ # @option options [String] :description A description of the property.
# @option options [Symbol] :instance_variable_name The instance variable
# tied to this property. Must include a leading `@`. Defaults to `@<name>`.
# `nil` means the property is opaque and not tied to a specific instance
@@ -158,6 +159,15 @@ class Chef
end
#
+ # A description of this property.
+ #
+ # @return [String]
+ #
+ def description
+ options[:description]
+ end
+
+ #
# The instance variable associated with this property.
#
# Defaults to `@<name>`
@@ -252,7 +262,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].include?(k)
+ [:declared_in, :name, :instance_variable_name, :desired_state, :identity, :default, :name_property, :coerce, :required, :nillable, :sensitive, :description].include?(k)
end
end