summaryrefslogtreecommitdiff
path: root/lib/chef/mixin/properties.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-03 13:11:13 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-05 12:41:04 -0700
commit9802d7c075c8b7dae42dbcecd92d492f7fa128ac (patch)
tree0d13de92dc631081f9bcdaddedd6294051e3423b /lib/chef/mixin/properties.rb
parent4978a9a8a402477f3b35f43404701d6a5cf26fa1 (diff)
downloadchef-9802d7c075c8b7dae42dbcecd92d492f7fa128ac.tar.gz
Style/NegatedIf
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/mixin/properties.rb')
-rw-r--r--lib/chef/mixin/properties.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/mixin/properties.rb b/lib/chef/mixin/properties.rb
index faf047885c..dcae012a23 100644
--- a/lib/chef/mixin/properties.rb
+++ b/lib/chef/mixin/properties.rb
@@ -102,7 +102,7 @@ class Chef
options = options.inject({}) { |memo, (key, value)| memo[key.to_sym] = value; memo }
- options[:instance_variable_name] = :"@#{name}" if !options.key?(:instance_variable_name)
+ options[:instance_variable_name] = :"@#{name}" unless options.key?(:instance_variable_name)
options[:name] = name
options[:declared_in] = self
@@ -191,7 +191,7 @@ class Chef
# @return [Array<Property>] All properties in desired state.
#
def state_properties(*names)
- if !names.empty?
+ unless names.empty?
names = names.map { |name| name.to_sym }.uniq
local_properties = properties(false)
@@ -240,7 +240,7 @@ class Chef
# @return [Array<Property>] All identity properties.
#
def identity_properties(*names)
- if !names.empty?
+ unless names.empty?
names = names.map { |name| name.to_sym }
# Add or change properties that are not part of the identity.
@@ -288,7 +288,7 @@ class Chef
#
def property_is_set?(name)
property = self.class.properties[name.to_sym]
- raise ArgumentError, "Property #{name} is not defined in class #{self}" if !property
+ raise ArgumentError, "Property #{name} is not defined in class #{self}" unless property
property.is_set?(self)
end
@@ -302,7 +302,7 @@ class Chef
#
def reset_property(name)
property = self.class.properties[name.to_sym]
- raise ArgumentError, "Property #{name} is not defined in class #{self}" if !property
+ raise ArgumentError, "Property #{name} is not defined in class #{self}" unless property
property.reset(self)
end
@@ -314,7 +314,7 @@ class Chef
# @return [String] The description of the property.
def property_description(name)
property = self.class.properties[name.to_sym]
- raise ArgumentError, "Property #{name} is not defined in class #{self}" if !property
+ raise ArgumentError, "Property #{name} is not defined in class #{self}" unless property
property.description
end