summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-10-12 10:38:20 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-10-12 10:38:20 -0700
commita586fc56889428dd47997a81aa5ace88b0aa8882 (patch)
tree7a86eb6d071efc98b4b58d623eb8664a7865cb91
parent91f37f3571711fae47ffc327f220c13bba9cf7bd (diff)
downloadchef-a586fc56889428dd47997a81aa5ace88b0aa8882.tar.gz
remove misleading @delayed_action ivar
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/resource.rb22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 8048330ce1..74acd94e9b 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -186,22 +186,16 @@ class Chef
# This should most likely be paired with action :nothing
#
# @param arg [Array[Symbol], Symbol] A list of actions (e.g. `:create`)
- # @return [Array[Symbol]] the list of actions.
#
def delayed_action(arg = nil)
- if arg
- arg = Array(arg).map(&:to_sym)
- arg.each do |action|
- validate(
- { action: action },
- { action: { kind_of: Symbol, equal_to: allowed_actions } }
- )
- # the resource effectively sends a delayed notification to itself
- run_context.add_delayed_action(Notification.new(self, action, self))
- end
- @delayed_action = arg
- else
- @delayed_action
+ arg = Array(arg).map(&:to_sym)
+ arg.map do |action|
+ validate(
+ { action: action },
+ { action: { kind_of: Symbol, equal_to: allowed_actions } }
+ )
+ # the resource effectively sends a delayed notification to itself
+ run_context.add_delayed_action(Notification.new(self, action, self))
end
end