summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-07-30 19:49:42 -0600
committerJohn Keiser <john@johnkeiser.com>2015-07-31 12:42:29 -0600
commit2a600705e6f7740fca4212b2f7e34508d44babad (patch)
tree46fbc04b7e9aeb445848843ca1b8f04ba10d3465 /lib/chef/resource.rb
parent5d7a7fd7bc2af573854a7c3811c9e891c4b3e38c (diff)
downloadchef-2a600705e6f7740fca4212b2f7e34508d44babad.tar.gz
Move current_value_does_not_exist! directly on Resource
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 39fd05305f..b9c074117f 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -2,7 +2,7 @@
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: Christopher Walters (<cw@opscode.com>)
# Author:: John Keiser (<jkeiser@chef.io)
-# Copyright:: Copyright (c) 2008-2015 Opscode, Inc.
+# Copyright:: Copyright (c) 2008-2015 Chef, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -1385,14 +1385,17 @@ class Chef
# created resource with its identity values filled in.
#
def self.load_current_value(&load_block)
- include LoadCurrentValueDSL
define_method(:load_current_value!, &load_block)
end
- module LoadCurrentValueDSL
- def current_value_does_not_exist!
- raise Chef::Exceptions::CurrentValueDoesNotExist
- end
+ #
+ # Call this in `load_current_value` to indicate that the value does not
+ # exist and that `current_resource` should therefore be `nil`.
+ #
+ # @raise Chef::Exceptions::CurrentValueDoesNotExist
+ #
+ def current_value_does_not_exist!
+ raise Chef::Exceptions::CurrentValueDoesNotExist
end
#