summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-06-05 16:49:23 +0200
committerGeremia Taglialatela <[email protected]>2023-06-05 17:27:41 +0200
commit0cc60e3eb08e11542612871e2e15350ed07fff06 (patch)
treeae63495552175e26ab6be3aefe190a7e5ab657a9 /lib/axlsx/drawing
parent7fdbd745a2c914001a2174aeadae26b9c970ffaf (diff)
downloadcaxlsx-0cc60e3eb08e11542612871e2e15350ed07fff06.tar.gz
caxlsx-0cc60e3eb08e11542612871e2e15350ed07fff06.zip
Fix Style/RedundantInterpolation offenses
`%` is an operation on `String` that will return a new `String`, so the interpolation is redundant Also adds a missing spec on PivotTable#rels_pn ``` IPS: uninterpolated: 4045715.7 i/s interpolated: 2359775.6 i/s - 1.71x (± 0.00) slower Memory: uninterpolated: 160 allocated interpolated: 232 allocated - 1.45x more ```
Diffstat (limited to 'lib/axlsx/drawing')
-rw-r--r--lib/axlsx/drawing/chart.rb2
-rw-r--r--lib/axlsx/drawing/drawing.rb4
-rw-r--r--lib/axlsx/drawing/pic.rb2
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/axlsx/drawing/chart.rb b/lib/axlsx/drawing/chart.rb
index 9f59dc6a..6b3acab1 100644
--- a/lib/axlsx/drawing/chart.rb
+++ b/lib/axlsx/drawing/chart.rb
@@ -124,7 +124,7 @@ module Axlsx
# The part name for this chart
# @return [String]
def pn
- "#{CHART_PN % (index + 1)}"
+ CHART_PN % (index + 1)
end
# The title object for the chart.
diff --git a/lib/axlsx/drawing/drawing.rb b/lib/axlsx/drawing/drawing.rb
index fa7a608c..8ae4ed0c 100644
--- a/lib/axlsx/drawing/drawing.rb
+++ b/lib/axlsx/drawing/drawing.rb
@@ -128,14 +128,14 @@ module Axlsx
# The part name for this drawing
# @return [String]
def pn
- "#{DRAWING_PN % (index + 1)}"
+ DRAWING_PN % (index + 1)
end
# The relational part name for this drawing
# #NOTE This should be rewritten to return an Axlsx::Relationship object.
# @return [String]
def rels_pn
- "#{DRAWING_RELS_PN % (index + 1)}"
+ DRAWING_RELS_PN % (index + 1)
end
# A list of objects this drawing holds.
diff --git a/lib/axlsx/drawing/pic.rb b/lib/axlsx/drawing/pic.rb
index c9efb378..08beb2d9 100644
--- a/lib/axlsx/drawing/pic.rb
+++ b/lib/axlsx/drawing/pic.rb
@@ -131,7 +131,7 @@ module Axlsx
# @return [Relationship]
def relationship
if remote?
- Relationship.new(self, IMAGE_R, "#{image_src}", target_mode: :External)
+ Relationship.new(self, IMAGE_R, image_src.to_s, target_mode: :External)
else
Relationship.new(self, IMAGE_R, "../#{pn}")
end