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/content_type | |
| 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/content_type')
| -rw-r--r-- | lib/axlsx/content_type/abstract_content_type.rb | 4 | ||||
| -rw-r--r-- | lib/axlsx/content_type/default.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/content_type/override.rb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/axlsx/content_type/abstract_content_type.rb b/lib/axlsx/content_type/abstract_content_type.rb index 6aae8c4b..30ab9f35 100644 --- a/lib/axlsx/content_type/abstract_content_type.rb +++ b/lib/axlsx/content_type/abstract_content_type.rb @@ -18,7 +18,7 @@ module Axlsx # The content type. # @see Axlsx#validate_content_type - def content_type=(v) Axlsx::validate_content_type v; @content_type = v end + def content_type=(v) Axlsx.validate_content_type v; @content_type = v end alias :ContentType= :content_type= # Serialize the contenty type to xml @@ -26,7 +26,7 @@ module Axlsx str << '<' << node_name << ' ' Axlsx.instance_values_for(self).each_with_index do |key_value, index| str << ' ' unless index.zero? - str << Axlsx::camel(key_value.first) << '="' << key_value.last.to_s << '"' + str << Axlsx.camel(key_value.first) << '="' << key_value.last.to_s << '"' end str << '/>' end diff --git a/lib/axlsx/content_type/default.rb b/lib/axlsx/content_type/default.rb index 16189fc6..2fbeb380 100644 --- a/lib/axlsx/content_type/default.rb +++ b/lib/axlsx/content_type/default.rb @@ -12,7 +12,7 @@ module Axlsx alias :Extension :extension # Sets the file extension for this content type. - def extension=(v) Axlsx::validate_string v; @extension = v end + def extension=(v) Axlsx.validate_string v; @extension = v end alias :Extension= :extension= # Serializes this object to xml diff --git a/lib/axlsx/content_type/override.rb b/lib/axlsx/content_type/override.rb index be45db3c..99db7546 100644 --- a/lib/axlsx/content_type/override.rb +++ b/lib/axlsx/content_type/override.rb @@ -12,7 +12,7 @@ module Axlsx alias :PartName :part_name # The name and location of the part. - def part_name=(v) Axlsx::validate_string v; @part_name = v end + def part_name=(v) Axlsx.validate_string v; @part_name = v end alias :PartName= :part_name= # Serializes this object to xml |
