summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/package.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-17 11:17:45 +0200
committerGeremia Taglialatela <[email protected]>2023-05-24 10:03:50 +0200
commit84a7132924b1c56f712a830b4e016a3c033923bf (patch)
tree1bccc27e18be9287d568cd4c6313dbe33495acad /lib/axlsx/package.rb
parent14b7da239879d5299775c48666b43f3016add8ec (diff)
downloadcaxlsx-84a7132924b1c56f712a830b4e016a3c033923bf.tar.gz
caxlsx-84a7132924b1c56f712a830b4e016a3c033923bf.zip
Do not use collection literal in loops
Also refactors Page margins to avoid code duplication
Diffstat (limited to 'lib/axlsx/package.rb')
-rw-r--r--lib/axlsx/package.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb
index 2983ed72..20195ddc 100644
--- a/lib/axlsx/package.rb
+++ b/lib/axlsx/package.rb
@@ -330,11 +330,11 @@ module Axlsx
end
exts = workbook.images.map { |image| image.extname.downcase }
exts.uniq.each do |ext|
- ct = if ['jpeg', 'jpg'].include?(ext)
+ ct = if JPEG_EXS.include?(ext)
JPEG_CT
- elsif ext == 'gif'
+ elsif ext == GIF_EX
GIF_CT
- elsif ext == 'png'
+ elsif ext == PNG_EX
PNG_CT
end
c_types << Axlsx::Default.new(:ContentType => ct, :Extension => ext)