summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-03-04 11:39:11 -0800
committerTim Smith <tsmith84@gmail.com>2020-03-09 15:58:22 -0700
commit80a6ae159623c2b32855eb603cc826c04a4ec7aa (patch)
tree684e63956621d685b7cd39c97d594804a8b4941b
parentd38e9393026d2dfdfd35a3e7d319ce735ebc9162 (diff)
downloadchef-80a6ae159623c2b32855eb603cc826c04a4ec7aa.tar.gz
Expose equal_to values in property / chef-resource-inspector
We need this information so we can generator documentation that includes these values. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/property.rb12
-rw-r--r--lib/chef/resource_inspector.rb5
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/chef/property.rb b/lib/chef/property.rb
index 34fde05020..336331b59f 100644
--- a/lib/chef/property.rb
+++ b/lib/chef/property.rb
@@ -1,6 +1,7 @@
#
# Author:: John Keiser <jkeiser@chef.io>
-# Copyright:: Copyright 2015-2016, John Keiser.
+# Copyright:: Copyright 2015-2016, John Keiser
+# Copyright:: Copyright 2015-2020, Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -245,6 +246,15 @@ class Chef
end
#
+ # The equal_to field of this property.
+ #
+ # @return [Array, NilClass]
+ #
+ def equal_to
+ options[:equal_to]
+ end
+
+ #
# Whether this is part of the resource's natural identity or not.
#
# @return [Boolean]
diff --git a/lib/chef/resource_inspector.rb b/lib/chef/resource_inspector.rb
index 187bd6338b..b3c2f4d1e0 100644
--- a/lib/chef/resource_inspector.rb
+++ b/lib/chef/resource_inspector.rb
@@ -1,4 +1,4 @@
-# Copyright:: Copyright 2018, Chef Software, Inc
+# Copyright:: Copyright 2018-2020, Chef Software, Inc
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -58,7 +58,8 @@ module ResourceInspector
deprecated: opts[:deprecated] || false,
required: opts[:required] || false,
default: opts[:default_description] || get_default(opts[:default]),
- name_property: opts[:name_property] || false }
+ name_property: opts[:name_property] || false,
+ equal_to: opts[:equal_to] || [] }
end
data
end