summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/cell.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-06-10 11:48:13 +0200
committerGeremia Taglialatela <[email protected]>2023-06-10 11:48:13 +0200
commitee14c1bf5c6aaa96867eb4b90b510f91c3a614f8 (patch)
tree63a893a73f1cc51003edf218fed178bb93c604d7 /lib/axlsx/workbook/worksheet/cell.rb
parentcfb516062de3d0725b3245cc328f96d702d662d3 (diff)
downloadcaxlsx-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/worksheet/cell.rb')
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb
index b9f78fdb..4e667e06 100644
--- a/lib/axlsx/workbook/worksheet/cell.rb
+++ b/lib/axlsx/workbook/worksheet/cell.rb
@@ -345,7 +345,7 @@ module Axlsx
# @example Relative Cell Reference
# ws.rows.first.cells.first.r #=> "A1"
def r
- Axlsx::cell_r index, @row.row_index
+ Axlsx.cell_r index, @row.row_index
end
# @return [String] The absolute alpha(column)numeric(row) reference for this cell.
@@ -358,7 +358,7 @@ module Axlsx
# @return [Integer] The cellXfs item index applied to this cell.
# @raise [ArgumentError] Invalid cellXfs id if the value provided is not within cellXfs items range.
def style=(v)
- Axlsx::validate_unsigned_int(v)
+ Axlsx.validate_unsigned_int(v)
count = styles.cellXfs.size
raise ArgumentError, "Invalid cellXfs id" unless v < count
@@ -446,8 +446,8 @@ module Axlsx
# TODO find a better way to do this as it accounts for 30% of
# processing time in benchmarking...
def clean_value
- if (type == :string || type == :text) && !Axlsx::trust_input
- Axlsx::sanitize(::CGI.escapeHTML(@value.to_s))
+ if (type == :string || type == :text) && !Axlsx.trust_input
+ Axlsx.sanitize(::CGI.escapeHTML(@value.to_s))
else
@value.to_s
end
@@ -488,7 +488,7 @@ module Axlsx
# @see ssti
def ssti=(v)
- Axlsx::validate_unsigned_int(v)
+ Axlsx.validate_unsigned_int(v)
@ssti = v
end