summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-20 17:35:54 +0200
committerGeremia Taglialatela <[email protected]>2023-05-20 17:35:54 +0200
commit7b220f91322ca7bdee393ddbc3327c50a45fbbcd (patch)
treee7e872f45a576d3bbeed19c3976b901ddcd9d721 /lib
parent6a4b82def2e94b4811c38c37e606d426710d1e6c (diff)
downloadcaxlsx-7b220f91322ca7bdee393ddbc3327c50a45fbbcd.tar.gz
caxlsx-7b220f91322ca7bdee393ddbc3327c50a45fbbcd.zip
Fix Style/AndOr offenses
From Ruby Style Guide: > Do not use `and` and `or` in boolean context - and and or are control flow operators and should be used as such. They have very low precedence, and can be used as a short form of specifying flow sequences like "evaluate expression 1, and only if it is not successful (returned `nil`), evaluate expression 2". This is especially useful for raising errors or early return without breaking the reading flow. Also: - Remove redundant use of self - Use attribute reader instead of accessing instance variable
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/data_validation.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/worksheet/data_validation.rb b/lib/axlsx/workbook/worksheet/data_validation.rb
index eca90743..bc9bc527 100644
--- a/lib/axlsx/workbook/worksheet/data_validation.rb
+++ b/lib/axlsx/workbook/worksheet/data_validation.rb
@@ -243,8 +243,8 @@ module Axlsx
str << key_value.first << '="' << Axlsx.booleanize(key_value.last).to_s << '"'
end
str << '>'
- str << '<formula1>' << self.formula1 << '</formula1>' if @formula1 and valid_attributes.include?(:formula1)
- str << '<formula2>' << self.formula2 << '</formula2>' if @formula2 and valid_attributes.include?(:formula2)
+ str << '<formula1>' << formula1 << '</formula1>' if formula1 && valid_attributes.include?(:formula1)
+ str << '<formula2>' << formula2 << '</formula2>' if formula2 && valid_attributes.include?(:formula2)
str << '</dataValidation>'
end