From e86b8e83ba571b84307a5f04e1eb64703eb523f2 Mon Sep 17 00:00:00 2001 From: dmitrys Date: Mon, 23 Oct 2017 12:28:28 -0400 Subject: Action is converted to symbol if possible Signed-off-by: dmitrys --- lib/chef/resource/resource_notification.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/chef') diff --git a/lib/chef/resource/resource_notification.rb b/lib/chef/resource/resource_notification.rb index ee90064a17..2786e4c39b 100644 --- a/lib/chef/resource/resource_notification.rb +++ b/lib/chef/resource/resource_notification.rb @@ -26,7 +26,11 @@ class Chef def initialize(resource, action, notifying_resource) @resource = resource - @action = action + @action = if action.respond_to?(:to_sym) + action.to_sym + else + action + end @notifying_resource = notifying_resource end -- cgit v1.2.1 From 335de911e800a49b94565ea7cb56c50ed1ae39a6 Mon Sep 17 00:00:00 2001 From: Dmitry Shestoperov Date: Tue, 7 Nov 2017 23:16:51 -0500 Subject: Simplified conversion Signed-off-by: Dmitry Shestoperov --- lib/chef/resource/resource_notification.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/chef') diff --git a/lib/chef/resource/resource_notification.rb b/lib/chef/resource/resource_notification.rb index 2786e4c39b..20e3c75b67 100644 --- a/lib/chef/resource/resource_notification.rb +++ b/lib/chef/resource/resource_notification.rb @@ -26,11 +26,7 @@ class Chef def initialize(resource, action, notifying_resource) @resource = resource - @action = if action.respond_to?(:to_sym) - action.to_sym - else - action - end + @action = action&.to_sym @notifying_resource = notifying_resource end -- cgit v1.2.1