summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-06-03 16:01:07 -0700
committerJohn Keiser <john@johnkeiser.com>2015-06-23 15:23:02 -0700
commita2ddd1133c57f7ae25cdebd0eb860bb8c3b148ad (patch)
tree9a0eeb99a23748c71775317bb52eebb9025de9a5 /lib/chef/resource.rb
parentc7f314f08d8baa0d5d8743153e244f0b4daec5e3 (diff)
downloadchef-a2ddd1133c57f7ae25cdebd0eb860bb8c3b148ad.tar.gz
Add lazy to Resource class DSL
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index cbab5e9c27..44247ca9f0 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -792,6 +792,17 @@ class Chef
end
end
+ #
+ # Create a lazy value for assignment to a default value.
+ #
+ # @param block The block to run when the value is retrieved.
+ #
+ # @return [Chef::DelayedEvaluator] The lazy value
+ #
+ def self.lazy(&block)
+ DelayedEvaluator.new(&block)
+ end
+
# Set or return the list of "state attributes" implemented by the Resource
# subclass. State attributes are attributes that describe the desired state
# of the system, such as file permissions or ownership. In general, state