summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Magnus Rakvåg <tor.magnus@outlook.com>2019-09-26 13:04:12 +0200
committerTor Magnus Rakvåg <tor.magnus@outlook.com>2019-09-26 13:04:12 +0200
commit4f5faf3b3f138625098c86c2a7fac7b006971890 (patch)
tree8c830ee9fbd07322855447bb21093c2d6628be2b
parent452076e44eb2118c8d08ce499b143e4a14848c45 (diff)
downloadchef-4f5faf3b3f138625098c86c2a7fac7b006971890.tar.gz
improved factoring
Signed-off-by: Tor Magnus Rakvåg <tor.magnus@outlook.com>
-rw-r--r--lib/chef/resource/windows_firewall_rule.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/chef/resource/windows_firewall_rule.rb b/lib/chef/resource/windows_firewall_rule.rb
index fa93403984..49bed5e9b6 100644
--- a/lib/chef/resource/windows_firewall_rule.rb
+++ b/lib/chef/resource/windows_firewall_rule.rb
@@ -70,15 +70,8 @@ class Chef
property :profile, [Symbol, String, Array],
default: :any,
description: "The profile the firewall rule applies to.",
- coerce: proc { |p|
- if p.is_a?(Array)
- p.map(&:downcase).map(&:to_sym).sort
- elsif p.is_a?(String)
- Array(p.downcase.to_sym).sort
- else
- Array(p).sort
- end
- }
+ coerce: proc { |p| Array(p).map(&:downcase).map(&:to_sym).sort }
+
property :program, String,
description: "The program the firewall rule applies to."