diff options
| author | Geremia Taglialatela <[email protected]> | 2023-06-10 11:48:13 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-06-10 11:48:13 +0200 |
| commit | ee14c1bf5c6aaa96867eb4b90b510f91c3a614f8 (patch) | |
| tree | 63a893a73f1cc51003edf218fed178bb93c604d7 /lib/axlsx/workbook/workbook.rb | |
| parent | cfb516062de3d0725b3245cc328f96d702d662d3 (diff) | |
| download | caxlsx-ee14c1bf5c6aaa96867eb4b90b510f91c3a614f8.tar.gz caxlsx-ee14c1bf5c6aaa96867eb4b90b510f91c3a614f8.zip | |
Fix safe Style/ColonMethodCall offenses
Caxlsx is using both `.` and `::`, 220 occurrences vs 280 to invoke
methods on `Axlsx` module.
This commit standardizes the approach towards `.`, which will also allow
shorter lines.
Performance is not affected
```
Comparison:
Axlsx.validate: 8515252.3 i/s
Axlsx::validate: 8512863.7 i/s - same-ish: difference falls within error
```
Diffstat (limited to 'lib/axlsx/workbook/workbook.rb')
| -rw-r--r-- | lib/axlsx/workbook/workbook.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/axlsx/workbook/workbook.rb b/lib/axlsx/workbook/workbook.rb index 0f4db9ce..c3597700 100644 --- a/lib/axlsx/workbook/workbook.rb +++ b/lib/axlsx/workbook/workbook.rb @@ -95,7 +95,7 @@ module Axlsx # @see use_shared_strings def use_shared_strings=(v) - Axlsx::validate_boolean(v) + Axlsx.validate_boolean(v) @use_shared_strings = v end @@ -104,7 +104,7 @@ module Axlsx attr_reader :is_reversed def is_reversed=(v) - Axlsx::validate_boolean(v) + Axlsx.validate_boolean(v) @is_reversed = v end @@ -252,11 +252,11 @@ module Axlsx def date1904() @@date1904; end # see @date1904 - def date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end + def date1904=(v) Axlsx.validate_boolean v; @@date1904 = v; end # Sets the date1904 attribute to the provided boolean # @return [Boolean] - def self.date1904=(v) Axlsx::validate_boolean v; @@date1904 = v; end + def self.date1904=(v) Axlsx.validate_boolean v; @@date1904 = v; end # retrieves the date1904 attribute # @return [Boolean] @@ -283,7 +283,7 @@ module Axlsx def use_autowidth() @use_autowidth; end # see @use_autowidth - def use_autowidth=(v = true) Axlsx::validate_boolean v; @use_autowidth = v; end + def use_autowidth=(v = true) Axlsx.validate_boolean v; @use_autowidth = v; end # Font size of bold fonts is multiplied with this # Used for automatic calculation of cell widths with bold text @@ -291,7 +291,7 @@ module Axlsx attr_reader :bold_font_multiplier def bold_font_multiplier=(v) - Axlsx::validate_float v + Axlsx.validate_float v @bold_font_multiplier = v end @@ -301,7 +301,7 @@ module Axlsx attr_reader :font_scale_divisor def font_scale_divisor=(v) - Axlsx::validate_float v + Axlsx.validate_float v @font_scale_divisor = v end |
