diff options
| author | Geremia Taglialatela <[email protected]> | 2023-05-31 17:31:59 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-31 17:31:59 +0200 |
| commit | 4e555613a021639c12be713c438bb124622c72d3 (patch) | |
| tree | e629fb11f494e85fa1e6205792111b83474d45d9 /lib/axlsx/util | |
| parent | ad87c51bf8c8f59a36514bb95dc6d3a582c6b2fd (diff) | |
| download | caxlsx-4e555613a021639c12be713c438bb124622c72d3.tar.gz caxlsx-4e555613a021639c12be713c438bb124622c72d3.zip | |
Remove redundant parentheses
- Style/ParenthesesAroundCondition
- Style/RedundantParentheses
- Style/TernaryParentheses
`Style/ParenthesesAroundCondition` may be questionable, but a majority
of comparison where not using parentheses, so offenses have been fixed
for uniformity across the codebase
Diffstat (limited to 'lib/axlsx/util')
| -rw-r--r-- | lib/axlsx/util/validators.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb index 695d28ad..48c12c13 100644 --- a/lib/axlsx/util/validators.rb +++ b/lib/axlsx/util/validators.rb @@ -41,7 +41,7 @@ module Axlsx # @param [Regexp] regex The regular expression to evaluate # @param [Any] v The value to validate. def self.validate(name, regex, v) - raise ArgumentError, (ERR_REGEX % [v.inspect, regex.to_s]) unless (v.respond_to?(:to_s) && regex.match?(v.to_s)) + raise ArgumentError, (ERR_REGEX % [v.inspect, regex.to_s]) unless v.respond_to?(:to_s) && regex.match?(v.to_s) end end @@ -71,7 +71,7 @@ module Axlsx # @para, [Any] v the value to validate # @raise [ArgumentError] raised if the value cannot be converted to an integer def self.validate_integerish(v) - raise ArgumentError, (ERR_INTEGERISH % v.inspect) unless (v.respond_to?(:to_i) && v.to_i.is_a?(Integer)) + raise ArgumentError, (ERR_INTEGERISH % v.inspect) unless v.respond_to?(:to_i) && v.to_i.is_a?(Integer) end # Requires that the value is between -54000000 and 54000000 @@ -79,7 +79,7 @@ module Axlsx # @raise [ArgumentError] raised if the value cannot be converted to an integer between the allowed angle values for chart label rotation. # @return [Boolean] true if the data is valid def self.validate_angle(v) - raise ArgumentError, (ERR_ANGLE % v.inspect) unless (v.to_i >= -5400000 && v.to_i <= 5400000) + raise ArgumentError, (ERR_ANGLE % v.inspect) unless v.to_i >= -5400000 && v.to_i <= 5400000 end # Validates an unsigned intger |
