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-04 11:39:11 -0800
commite2efc122f363dcf748e77e4f6735acbfeccd5c9b (patch)
tree1178bfc1042f356e2061f2d970461376ac8ed89a
parent5139c1a3fbf3535d763c31b3071022dc3a4ab3d5 (diff)
downloadchef-equal_to.tar.gz
Expose equal_to values in property / chef-resource-inspectorequal_to
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 8d92db04b6..327a9116d2 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