summaryrefslogtreecommitdiff
path: root/lib/chef/property.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-02 15:09:07 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-02 15:09:07 -0700
commit7a1a6c8ef26c787e4b6dd1602f3d158b37e81720 (patch)
tree1e390cd535b38368d091cbb33e5d419408d5ce00 /lib/chef/property.rb
parent77f8739a4741e2370e40ec39345a92a6ea393a1a (diff)
downloadchef-7a1a6c8ef26c787e4b6dd1602f3d158b37e81720.tar.gz
fix Layout/EmptyLineAfterGuardClause
i like this one, gives visual priority to returns or raises that are buried in the middle of things. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/property.rb')
-rw-r--r--lib/chef/property.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/chef/property.rb b/lib/chef/property.rb
index c26146a96b..24dbd56f2c 100644
--- a/lib/chef/property.rb
+++ b/lib/chef/property.rb
@@ -130,6 +130,7 @@ class Chef
if options.key?(:name_property)
raise ArgumentError, "name_attribute and name_property are functionally identical and both cannot be specified on a property at once. Use just one on property #{self}"
end
+
# replace name_property with name_attribute in place
options = Hash[options.map { |k, v| k == :name_attribute ? [ :name_property, v ] : [ k, v ] }]
@options = options
@@ -230,6 +231,7 @@ class Chef
def default
return options[:default] if options.key?(:default)
return Chef::DelayedEvaluator.new { name } if name_property?
+
nil
end
@@ -260,6 +262,7 @@ class Chef
#
def desired_state?
return true if !options.key?(:desired_state)
+
options[:desired_state]
end