diff options
| author | Zsolt Kozaroczy <[email protected]> | 2023-06-05 10:23:47 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-06-05 10:23:47 +0200 |
| commit | d9857fee81eb57935848039c6548d81f3339d728 (patch) | |
| tree | e629fb11f494e85fa1e6205792111b83474d45d9 /lib/axlsx/util/validators.rb | |
| parent | ad87c51bf8c8f59a36514bb95dc6d3a582c6b2fd (diff) | |
| parent | 4e555613a021639c12be713c438bb124622c72d3 (diff) | |
| download | caxlsx-d9857fee81eb57935848039c6548d81f3339d728.tar.gz caxlsx-d9857fee81eb57935848039c6548d81f3339d728.zip | |
Merge pull request #271 from tagliala/chore/fix-redundant-parentheses
Remove redundant parentheses
Diffstat (limited to 'lib/axlsx/util/validators.rb')
| -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 |
