summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-06-04 10:43:38 -0700
committerJohn Keiser <john@johnkeiser.com>2015-06-23 15:23:02 -0700
commitf47252a75191d96e169abdc7c9d84aa6e50df708 (patch)
tree45dcb92ca96ff5b1881bc227236e81a86a3e946a /lib/chef/resource.rb
parent2d7f1282c63ca6480f363603608e9d3cdf38116e (diff)
downloadchef-f47252a75191d96e169abdc7c9d84aa6e50df708.tar.gz
Add property_is_set?
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 9496656705..8d2532dac4 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -791,6 +791,15 @@ class Chef
end
#
+ # Whether this property has been set (or whether it has a default that has
+ # been retrieved).
+ #
+ def property_is_set?(name)
+ name = name.to_sym
+ instance_variable_defined?("@#{name}")
+ end
+
+ #
# Create a lazy value for assignment to a default value.
#
# @param block The block to run when the value is retrieved.