summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-31 11:04:13 +0200
committerGeremia Taglialatela <[email protected]>2023-05-31 11:04:13 +0200
commit42594ea9e486d3b0fe9c84ba1fc59140bb59439f (patch)
tree1a666e99ccebefa4be1df5655b96f9f1337df794 /lib/axlsx
parentcbcf330ea266c96861e4029aaea6be1063862900 (diff)
downloadcaxlsx-42594ea9e486d3b0fe9c84ba1fc59140bb59439f.tar.gz
caxlsx-42594ea9e486d3b0fe9c84ba1fc59140bb59439f.zip
Use Ruby 1.9 hash syntax
Diffstat (limited to 'lib/axlsx')
-rw-r--r--lib/axlsx/drawing/area_chart.rb4
-rw-r--r--lib/axlsx/drawing/area_series.rb2
-rw-r--r--lib/axlsx/drawing/axis.rb2
-rw-r--r--lib/axlsx/drawing/bar_3D_chart.rb6
-rw-r--r--lib/axlsx/drawing/bar_chart.rb4
-rw-r--r--lib/axlsx/drawing/bar_series.rb2
-rw-r--r--lib/axlsx/drawing/bubble_chart.rb4
-rw-r--r--lib/axlsx/drawing/bubble_series.rb6
-rw-r--r--lib/axlsx/drawing/chart.rb2
-rw-r--r--lib/axlsx/drawing/hyperlink.rb4
-rw-r--r--lib/axlsx/drawing/line_3D_chart.rb2
-rw-r--r--lib/axlsx/drawing/line_chart.rb4
-rw-r--r--lib/axlsx/drawing/line_series.rb2
-rw-r--r--lib/axlsx/drawing/num_data.rb2
-rw-r--r--lib/axlsx/drawing/one_cell_anchor.rb2
-rw-r--r--lib/axlsx/drawing/pic.rb4
-rw-r--r--lib/axlsx/drawing/pie_3D_chart.rb2
-rw-r--r--lib/axlsx/drawing/pie_series.rb2
-rw-r--r--lib/axlsx/drawing/scatter_chart.rb4
-rw-r--r--lib/axlsx/drawing/scatter_series.rb4
-rw-r--r--lib/axlsx/drawing/str_data.rb2
-rw-r--r--lib/axlsx/drawing/two_cell_anchor.rb2
-rw-r--r--lib/axlsx/package.rb88
-rw-r--r--lib/axlsx/stylesheet/styles.rb40
-rw-r--r--lib/axlsx/stylesheet/table_style.rb2
-rw-r--r--lib/axlsx/stylesheet/table_styles.rb2
-rw-r--r--lib/axlsx/util/storage.rb10
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/col_breaks.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/color_scale.rb16
-rw-r--r--lib/axlsx/workbook/worksheet/comment.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/data_bar.rb6
-rw-r--r--lib/axlsx/workbook/worksheet/icon_set.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/pivot_table.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/protected_ranges.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/rich_text_run.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/row.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/row_breaks.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/sheet_pr.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/sheet_view.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet.rb6
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb4
42 files changed, 132 insertions, 132 deletions
diff --git a/lib/axlsx/drawing/area_chart.rb b/lib/axlsx/drawing/area_chart.rb
index 96711cd3..8a01f9f5 100644
--- a/lib/axlsx/drawing/area_chart.rb
+++ b/lib/axlsx/drawing/area_chart.rb
@@ -82,7 +82,7 @@ module Axlsx
@series.each { |ser| ser.to_xml_string(str) }
@d_lbls.to_xml_string(str) if @d_lbls
yield if block_given?
- axes.to_xml_string(str, :ids => true)
+ axes.to_xml_string(str, ids: true)
str << "</c:" << node_name << ">"
axes.to_xml_string(str)
end
@@ -92,7 +92,7 @@ module Axlsx
# axis.
# @return [Axes]
def axes
- @axes ||= Axes.new(:cat_axis => CatAxis, :val_axis => ValAxis)
+ @axes ||= Axes.new(cat_axis: CatAxis, val_axis: ValAxis)
end
end
end
diff --git a/lib/axlsx/drawing/area_series.rb b/lib/axlsx/drawing/area_series.rb
index afaf5ea0..c43fe929 100644
--- a/lib/axlsx/drawing/area_series.rb
+++ b/lib/axlsx/drawing/area_series.rb
@@ -41,7 +41,7 @@ module Axlsx
@smooth = false
@labels, @data = nil, nil
super(chart, options)
- @labels = AxDataSource.new(:data => options[:labels]) unless options[:labels].nil?
+ @labels = AxDataSource.new(data: options[:labels]) unless options[:labels].nil?
@data = NumDataSource.new(options) unless options[:data].nil?
end
diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb
index 10ddce1f..dfef7890 100644
--- a/lib/axlsx/drawing/axis.rb
+++ b/lib/axlsx/drawing/axis.rb
@@ -15,7 +15,7 @@ module Axlsx
@id = rand(8**8)
@format_code = "General"
@delete = @label_rotation = 0
- @scaling = Scaling.new(:orientation => :minMax)
+ @scaling = Scaling.new(orientation: :minMax)
@title = @color = nil
self.ax_pos = :b
self.tick_lbl_pos = :nextTo
diff --git a/lib/axlsx/drawing/bar_3D_chart.rb b/lib/axlsx/drawing/bar_3D_chart.rb
index fe347d7c..604a9d17 100644
--- a/lib/axlsx/drawing/bar_3D_chart.rb
+++ b/lib/axlsx/drawing/bar_3D_chart.rb
@@ -77,7 +77,7 @@ module Axlsx
@gap_width, @gap_depth, @shape = nil, nil, nil
super(frame, options)
@series_type = BarSeries
- @view_3D = View3D.new({ :r_ang_ax => 1 }.merge(options))
+ @view_3D = View3D.new({ r_ang_ax: 1 }.merge(options))
@d_lbls = nil
end
@@ -131,7 +131,7 @@ module Axlsx
str << '<c:gapWidth val="' << @gap_width.to_s << '"/>' unless @gap_width.nil?
str << '<c:gapDepth val="' << @gap_depth.to_s << '"/>' unless @gap_depth.nil?
str << '<c:shape val="' << @shape.to_s << '"/>' unless @shape.nil?
- axes.to_xml_string(str, :ids => true)
+ axes.to_xml_string(str, ids: true)
str << '</c:bar3DChart>'
axes.to_xml_string(str)
end
@@ -141,7 +141,7 @@ module Axlsx
# category axes specified via axes[:val_axes] and axes[:cat_axis]
# @return [Axes]
def axes
- @axes ||= Axes.new(:cat_axis => CatAxis, :val_axis => ValAxis)
+ @axes ||= Axes.new(cat_axis: CatAxis, val_axis: ValAxis)
end
end
end
diff --git a/lib/axlsx/drawing/bar_chart.rb b/lib/axlsx/drawing/bar_chart.rb
index 237ffdb3..87fd66c0 100644
--- a/lib/axlsx/drawing/bar_chart.rb
+++ b/lib/axlsx/drawing/bar_chart.rb
@@ -121,7 +121,7 @@ module Axlsx
str << '<c:overlap val="' << @overlap.to_s << '"/>' unless @overlap.nil?
str << '<c:gapWidth val="' << @gap_width.to_s << '"/>' unless @gap_width.nil?
str << '<c:shape val="' << @shape.to_s << '"/>' unless @shape.nil?
- axes.to_xml_string(str, :ids => true)
+ axes.to_xml_string(str, ids: true)
str << '</c:barChart>'
axes.to_xml_string(str)
end
@@ -131,7 +131,7 @@ module Axlsx
# category axes specified via axes[:val_axes] and axes[:cat_axis]
# @return [Axes]
def axes
- @axes ||= Axes.new(:cat_axis => CatAxis, :val_axis => ValAxis)
+ @axes ||= Axes.new(cat_axis: CatAxis, val_axis: ValAxis)
end
end
end
diff --git a/lib/axlsx/drawing/bar_series.rb b/lib/axlsx/drawing/bar_series.rb
index 483a0c43..11a315e2 100644
--- a/lib/axlsx/drawing/bar_series.rb
+++ b/lib/axlsx/drawing/bar_series.rb
@@ -38,7 +38,7 @@ module Axlsx
@shape = :box
@colors = []
super(chart, options)
- self.labels = AxDataSource.new({ :data => options[:labels] }) unless options[:labels].nil?
+ self.labels = AxDataSource.new({ data: options[:labels] }) unless options[:labels].nil?
self.data = NumDataSource.new(options) unless options[:data].nil?
end
diff --git a/lib/axlsx/drawing/bubble_chart.rb b/lib/axlsx/drawing/bubble_chart.rb
index 727f89a7..6b879e05 100644
--- a/lib/axlsx/drawing/bubble_chart.rb
+++ b/lib/axlsx/drawing/bubble_chart.rb
@@ -41,7 +41,7 @@ module Axlsx
str << '<c:varyColors val="' << vary_colors.to_s << '"/>'
@series.each { |ser| ser.to_xml_string(str) }
d_lbls.to_xml_string(str) if @d_lbls
- axes.to_xml_string(str, :ids => true)
+ axes.to_xml_string(str, ids: true)
str << '</c:bubbleChart>'
axes.to_xml_string(str)
end
@@ -52,7 +52,7 @@ module Axlsx
# a y_val_axis
# @return [Axes]
def axes
- @axes ||= Axes.new(:x_val_axis => ValAxis, :y_val_axis => ValAxis)
+ @axes ||= Axes.new(x_val_axis: ValAxis, y_val_axis: ValAxis)
end
end
end
diff --git a/lib/axlsx/drawing/bubble_series.rb b/lib/axlsx/drawing/bubble_series.rb
index b5903259..a30612ec 100644
--- a/lib/axlsx/drawing/bubble_series.rb
+++ b/lib/axlsx/drawing/bubble_series.rb
@@ -28,9 +28,9 @@ module Axlsx
def initialize(chart, options = {})
@xData, @yData, @bubbleSize = nil
super(chart, options)
- @xData = AxDataSource.new(:tag_name => :xVal, :data => options[:xData]) unless options[:xData].nil?
- @yData = NumDataSource.new({ :tag_name => :yVal, :data => options[:yData] }) unless options[:yData].nil?
- @bubbleSize = NumDataSource.new({ :tag_name => :bubbleSize, :data => options[:bubbleSize] }) unless options[:bubbleSize].nil?
+ @xData = AxDataSource.new(tag_name: :xVal, data: options[:xData]) unless options[:xData].nil?
+ @yData = NumDataSource.new({ tag_name: :yVal, data: options[:yData] }) unless options[:yData].nil?
+ @bubbleSize = NumDataSource.new({ tag_name: :bubbleSize, data: options[:bubbleSize] }) unless options[:bubbleSize].nil?
end
# @see color
diff --git a/lib/axlsx/drawing/chart.rb b/lib/axlsx/drawing/chart.rb
index 436319fb..9f59dc6a 100644
--- a/lib/axlsx/drawing/chart.rb
+++ b/lib/axlsx/drawing/chart.rb
@@ -187,7 +187,7 @@ module Axlsx
# Assigns a background color to chart area
def bg_color=(v)
- DataTypeValidator.validate(:color, Color, Color.new(:rgb => v))
+ DataTypeValidator.validate(:color, Color, Color.new(rgb: v))
@bg_color = v
end
diff --git a/lib/axlsx/drawing/hyperlink.rb b/lib/axlsx/drawing/hyperlink.rb
index 0d9eb4f7..acf3b8d2 100644
--- a/lib/axlsx/drawing/hyperlink.rb
+++ b/lib/axlsx/drawing/hyperlink.rb
@@ -86,14 +86,14 @@ module Axlsx
# The relationship object for this hyperlink.
# @return [Relationship]
def relationship
- Relationship.new(self, HYPERLINK_R, href, :target_mode => :External)
+ Relationship.new(self, HYPERLINK_R, href, target_mode: :External)
end
# Serializes the object
# @param [String] str
# @return [String]
def to_xml_string(str = +'')
- serialized_tag 'a:hlinkClick', str, { :'r:id' => relationship.Id, :'xmlns:r' => XML_NS_R }
+ serialized_tag 'a:hlinkClick', str, { 'r:id': relationship.Id, 'xmlns:r': XML_NS_R }
end
end
end
diff --git a/lib/axlsx/drawing/line_3D_chart.rb b/lib/axlsx/drawing/line_3D_chart.rb
index 60572785..024ece0a 100644
--- a/lib/axlsx/drawing/line_3D_chart.rb
+++ b/lib/axlsx/drawing/line_3D_chart.rb
@@ -42,7 +42,7 @@ module Axlsx
# @see View3D
def initialize(frame, options = {})
@gap_depth = nil
- @view_3D = View3D.new({ :r_ang_ax => 1 }.merge(options))
+ @view_3D = View3D.new({ r_ang_ax: 1 }.merge(options))
super(frame, options)
axes.add_axis :ser_axis, SerAxis
end
diff --git a/lib/axlsx/drawing/line_chart.rb b/lib/axlsx/drawing/line_chart.rb
index 21327820..14577900 100644
--- a/lib/axlsx/drawing/line_chart.rb
+++ b/lib/axlsx/drawing/line_chart.rb
@@ -82,7 +82,7 @@ module Axlsx
@series.each { |ser| ser.to_xml_string(str) }
@d_lbls.to_xml_string(str) if @d_lbls
yield if block_given?
- axes.to_xml_string(str, :ids => true)
+ axes.to_xml_string(str, ids: true)
str << "</c:" << node_name << ">"
axes.to_xml_string(str)
end
@@ -92,7 +92,7 @@ module Axlsx
# axis.
# @return [Axes]
def axes
- @axes ||= Axes.new(:cat_axis => CatAxis, :val_axis => ValAxis)
+ @axes ||= Axes.new(cat_axis: CatAxis, val_axis: ValAxis)
end
end
end
diff --git a/lib/axlsx/drawing/line_series.rb b/lib/axlsx/drawing/line_series.rb
index 4854a718..d6a412e4 100644
--- a/lib/axlsx/drawing/line_series.rb
+++ b/lib/axlsx/drawing/line_series.rb
@@ -41,7 +41,7 @@ module Axlsx
@smooth = false
@labels, @data = nil, nil
super(chart, options)
- @labels = AxDataSource.new(:data => options[:labels]) unless options[:labels].nil?
+ @labels = AxDataSource.new(data: options[:labels]) unless options[:labels].nil?
@data = NumDataSource.new(options) unless options[:data].nil?
end
diff --git a/lib/axlsx/drawing/num_data.rb b/lib/axlsx/drawing/num_data.rb
index fdcf505c..356926b2 100644
--- a/lib/axlsx/drawing/num_data.rb
+++ b/lib/axlsx/drawing/num_data.rb
@@ -25,7 +25,7 @@ module Axlsx
@tag_name = values.first.is_a?(Cell) ? :numCache : :numLit
values.each do |value|
value = value.is_formula? ? 0 : value.value if value.is_a?(Cell)
- @pt << NumVal.new(:v => value)
+ @pt << NumVal.new(v: value)
end
end
diff --git a/lib/axlsx/drawing/one_cell_anchor.rb b/lib/axlsx/drawing/one_cell_anchor.rb
index 59d0d972..402b51ab 100644
--- a/lib/axlsx/drawing/one_cell_anchor.rb
+++ b/lib/axlsx/drawing/one_cell_anchor.rb
@@ -93,7 +93,7 @@ module Axlsx
def ext
cy = @height * 914400 / 96
cx = @width * 914400 / 96
- { :cy => cy, :cx => cx }
+ { cy: cy, cx: cx }
end
end
end
diff --git a/lib/axlsx/drawing/pic.rb b/lib/axlsx/drawing/pic.rb
index 320a5254..150d6dc5 100644
--- a/lib/axlsx/drawing/pic.rb
+++ b/lib/axlsx/drawing/pic.rb
@@ -223,7 +223,7 @@ module Axlsx
def use_one_cell_anchor
return if @anchor.is_a?(OneCellAnchor)
- new_anchor = OneCellAnchor.new(@anchor.drawing, :start_at => [@anchor.from.col, @anchor.from.row])
+ new_anchor = OneCellAnchor.new(@anchor.drawing, start_at: [@anchor.from.col, @anchor.from.row])
swap_anchor(new_anchor)
end
@@ -231,7 +231,7 @@ module Axlsx
def use_two_cell_anchor
return if @anchor.is_a?(TwoCellAnchor)
- new_anchor = TwoCellAnchor.new(@anchor.drawing, :start_at => [@anchor.from.col, @anchor.from.row])
+ new_anchor = TwoCellAnchor.new(@anchor.drawing, start_at: [@anchor.from.col, @anchor.from.row])
swap_anchor(new_anchor)
end
diff --git a/lib/axlsx/drawing/pie_3D_chart.rb b/lib/axlsx/drawing/pie_3D_chart.rb
index aeb002d8..7fa87cde 100644
--- a/lib/axlsx/drawing/pie_3D_chart.rb
+++ b/lib/axlsx/drawing/pie_3D_chart.rb
@@ -24,7 +24,7 @@ module Axlsx
@vary_colors = true
super(frame, options)
@series_type = PieSeries
- @view_3D = View3D.new({ :rot_x => 30, :perspective => 30 }.merge(options))
+ @view_3D = View3D.new({ rot_x: 30, perspective: 30 }.merge(options))
@d_lbls = nil
end
diff --git a/lib/axlsx/drawing/pie_series.rb b/lib/axlsx/drawing/pie_series.rb
index cce79648..091267f4 100644
--- a/lib/axlsx/drawing/pie_series.rb
+++ b/lib/axlsx/drawing/pie_series.rb
@@ -31,7 +31,7 @@ module Axlsx
@explosion = nil
@colors = []
super(chart, options)
- self.labels = AxDataSource.new(:data => options[:labels]) unless options[:labels].nil?
+ self.labels = AxDataSource.new(data: options[:labels]) unless options[:labels].nil?
self.data = NumDataSource.new(options) unless options[:data].nil?
end
diff --git a/lib/axlsx/drawing/scatter_chart.rb b/lib/axlsx/drawing/scatter_chart.rb
index 60b7c5b3..b9fcffbd 100644
--- a/lib/axlsx/drawing/scatter_chart.rb
+++ b/lib/axlsx/drawing/scatter_chart.rb
@@ -56,7 +56,7 @@ module Axlsx
str << '<c:varyColors val="' << vary_colors.to_s << '"/>'
@series.each { |ser| ser.to_xml_string(str) }
d_lbls.to_xml_string(str) if @d_lbls
- axes.to_xml_string(str, :ids => true)
+ axes.to_xml_string(str, ids: true)
str << '</c:scatterChart>'
axes.to_xml_string(str)
end
@@ -67,7 +67,7 @@ module Axlsx
# a y_val_axis
# @return [Axes]
def axes
- @axes ||= Axes.new(:x_val_axis => ValAxis, :y_val_axis => ValAxis)
+ @axes ||= Axes.new(x_val_axis: ValAxis, y_val_axis: ValAxis)
end
end
end
diff --git a/lib/axlsx/drawing/scatter_series.rb b/lib/axlsx/drawing/scatter_series.rb
index 9e3579f7..2838c3de 100644
--- a/lib/axlsx/drawing/scatter_series.rb
+++ b/lib/axlsx/drawing/scatter_series.rb
@@ -51,8 +51,8 @@ module Axlsx
@marker_symbol = :default
super(chart, options)
- @xData = AxDataSource.new(:tag_name => :xVal, :data => options[:xData]) unless options[:xData].nil?
- @yData = NumDataSource.new({ :tag_name => :yVal, :data => options[:yData] }) unless options[:yData].nil?
+ @xData = AxDataSource.new(tag_name: :xVal, data: options[:xData]) unless options[:xData].nil?
+ @yData = NumDataSource.new({ tag_name: :yVal, data: options[:yData] }) unless options[:yData].nil?
end
# @see color
diff --git a/lib/axlsx/drawing/str_data.rb b/lib/axlsx/drawing/str_data.rb
index 5ab15c39..88c84c20 100644
--- a/lib/axlsx/drawing/str_data.rb
+++ b/lib/axlsx/drawing/str_data.rb
@@ -22,7 +22,7 @@ module Axlsx
@tag_name = values.first.is_a?(Cell) ? :strCache : :strLit
values.each do |value|
v = value.is_a?(Cell) ? value.value : value
- @pt << @type.new(:v => v)
+ @pt << @type.new(v: v)
end
end
diff --git a/lib/axlsx/drawing/two_cell_anchor.rb b/lib/axlsx/drawing/two_cell_anchor.rb
index bebfd28c..f017311b 100644
--- a/lib/axlsx/drawing/two_cell_anchor.rb
+++ b/lib/axlsx/drawing/two_cell_anchor.rb
@@ -35,7 +35,7 @@ module Axlsx
def initialize(drawing, options = {})
@drawing = drawing
drawing.anchors << self
- @from, @to = Marker.new, Marker.new(:col => 5, :row => 10)
+ @from, @to = Marker.new, Marker.new(col: 5, row: 10)
parse_options options
# bit of a hack to work around the fact that the coords for start at and end at
diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb
index 20195ddc..26f838f8 100644
--- a/lib/axlsx/package.rb
+++ b/lib/axlsx/package.rb
@@ -216,56 +216,56 @@ module Axlsx
# @private
def parts
parts = [
- { :entry => "xl/#{STYLES_PN}", :doc => workbook.styles, :schema => SML_XSD },
- { :entry => CORE_PN, :doc => @core, :schema => CORE_XSD },
- { :entry => APP_PN, :doc => @app, :schema => APP_XSD },
- { :entry => WORKBOOK_RELS_PN, :doc => workbook.relationships, :schema => RELS_XSD },
- { :entry => WORKBOOK_PN, :doc => workbook, :schema => SML_XSD }
+ { entry: "xl/#{STYLES_PN}", doc: workbook.styles, schema: SML_XSD },
+ { entry: CORE_PN, doc: @core, schema: CORE_XSD },
+ { entry: APP_PN, doc: @app, schema: APP_XSD },
+ { entry: WORKBOOK_RELS_PN, doc: workbook.relationships, schema: RELS_XSD },
+ { entry: WORKBOOK_PN, doc: workbook, schema: SML_XSD }
]
workbook.drawings.each do |drawing|
- parts << { :entry => "xl/#{drawing.rels_pn}", :doc => drawing.relationships, :schema => RELS_XSD }
- parts << { :entry => "xl/#{drawing.pn}", :doc => drawing, :schema => DRAWING_XSD }
+ parts << { entry: "xl/#{drawing.rels_pn}", doc: drawing.relationships, schema: RELS_XSD }
+ parts << { entry: "xl/#{drawing.pn}", doc: drawing, schema: DRAWING_XSD }
end
workbook.tables.each do |table|
- parts << { :entry => "xl/#{table.pn}", :doc => table, :schema => SML_XSD }
+ parts << { entry: "xl/#{table.pn}", doc: table, schema: SML_XSD }
end
workbook.pivot_tables.each do |pivot_table|
cache_definition = pivot_table.cache_definition
- parts << { :entry => "xl/#{pivot_table.rels_pn}", :doc => pivot_table.relationships, :schema => RELS_XSD }
- parts << { :entry => "xl/#{pivot_table.pn}", :doc => pivot_table } # , :schema => SML_XSD}
- parts << { :entry => "xl/#{cache_definition.pn}", :doc => cache_definition } # , :schema => SML_XSD}
+ parts << { entry: "xl/#{pivot_table.rels_pn}", doc: pivot_table.relationships, schema: RELS_XSD }
+ parts << { entry: "xl/#{pivot_table.pn}", doc: pivot_table } # , :schema => SML_XSD}
+ parts << { entry: "xl/#{cache_definition.pn}", doc: cache_definition } # , :schema => SML_XSD}
end
workbook.comments.each do |comment|
unless comment.empty?
- parts << { :entry => "xl/#{comment.pn}", :doc => comment, :schema => SML_XSD }
- parts << { :entry => "xl/#{comment.vml_drawing.pn}", :doc => comment.vml_drawing, :schema => nil }
+ parts << { entry: "xl/#{comment.pn}", doc: comment, schema: SML_XSD }
+ parts << { entry: "xl/#{comment.vml_drawing.pn}", doc: comment.vml_drawing, schema: nil }
end
end
workbook.charts.each do |chart|
- parts << { :entry => "xl/#{chart.pn}", :doc => chart, :schema => DRAWING_XSD }
+ parts << { entry: "xl/#{chart.pn}", doc: chart, schema: DRAWING_XSD }
end
workbook.images.each do |image|
- parts << { :entry => "xl/#{image.pn}", :path => image.image_src } unless image.remote?
+ parts << { entry: "xl/#{image.pn}", path: image.image_src } unless image.remote?
end
if use_shared_strings
- parts << { :entry => "xl/#{SHARED_STRINGS_PN}", :doc => workbook.shared_strings, :schema => SML_XSD }
+ parts << { entry: "xl/#{SHARED_STRINGS_PN}", doc: workbook.shared_strings, schema: SML_XSD }
end
workbook.worksheets.each do |sheet|
- parts << { :entry => "xl/#{sheet.rels_pn}", :doc => sheet.relationships, :schema => RELS_XSD }
- parts << { :entry => "xl/#{sheet.pn}", :doc => sheet, :schema => SML_XSD }
+ parts << { entry: "xl/#{sheet.rels_pn}", doc: sheet.relationships, schema: RELS_XSD }
+ parts << { entry: "xl/#{sheet.pn}", doc: sheet, schema: SML_XSD }
end
# Sort parts for correct MIME detection
[
- { :entry => CONTENT_TYPES_PN, :doc => content_types, :schema => CONTENT_TYPES_XSD },
- { :entry => RELS_PN, :doc => relationships, :schema => RELS_XSD },
+ { entry: CONTENT_TYPES_PN, doc: content_types, schema: CONTENT_TYPES_XSD },
+ { entry: RELS_PN, doc: relationships, schema: RELS_XSD },
*(parts.sort_by { |part| part[:entry] }.reverse)
]
end
@@ -292,41 +292,41 @@ module Axlsx
def content_types
c_types = base_content_types
workbook.drawings.each do |drawing|
- c_types << Axlsx::Override.new(:PartName => "/xl/#{drawing.pn}",
- :ContentType => DRAWING_CT)
+ c_types << Axlsx::Override.new(PartName: "/xl/#{drawing.pn}",
+ ContentType: DRAWING_CT)
end
workbook.charts.each do |chart|
- c_types << Axlsx::Override.new(:PartName => "/xl/#{chart.pn}",
- :ContentType => CHART_CT)
+ c_types << Axlsx::Override.new(PartName: "/xl/#{chart.pn}",
+ ContentType: CHART_CT)
end
workbook.tables.each do |table|
- c_types << Axlsx::Override.new(:PartName => "/xl/#{table.pn}",
- :ContentType => TABLE_CT)
+ c_types << Axlsx::Override.new(PartName: "/xl/#{table.pn}",
+ ContentType: TABLE_CT)
end
workbook.pivot_tables.each do |pivot_table|
- c_types << Axlsx::Override.new(:PartName => "/xl/#{pivot_table.pn}",
- :ContentType => PIVOT_TABLE_CT)
- c_types << Axlsx::Override.new(:PartName => "/xl/#{pivot_table.cache_definition.pn}",
- :ContentType => PIVOT_TABLE_CACHE_DEFINITION_CT)
+ c_types << Axlsx::Override.new(PartName: "/xl/#{pivot_table.pn}",
+ ContentType: PIVOT_TABLE_CT)
+ c_types << Axlsx::Override.new(PartName: "/xl/#{pivot_table.cache_definition.pn}",
+ ContentType: PIVOT_TABLE_CACHE_DEFINITION_CT)
end
workbook.comments.each do |comment|
unless comment.empty?
- c_types << Axlsx::Override.new(:PartName => "/xl/#{comment.pn}",
- :ContentType => COMMENT_CT)
+ c_types << Axlsx::Override.new(PartName: "/xl/#{comment.pn}",
+ ContentType: COMMENT_CT)
end
end
unless workbook.comments.empty?
- c_types << Axlsx::Default.new(:Extension => "vml", :ContentType => VML_DRAWING_CT)
+ c_types << Axlsx::Default.new(Extension: "vml", ContentType: VML_DRAWING_CT)
end
workbook.worksheets.each do |sheet|
- c_types << Axlsx::Override.new(:PartName => "/xl/#{sheet.pn}",
- :ContentType => WORKSHEET_CT)
+ c_types << Axlsx::Override.new(PartName: "/xl/#{sheet.pn}",
+ ContentType: WORKSHEET_CT)
end
exts = workbook.images.map { |image| image.extname.downcase }
exts.uniq.each do |ext|
@@ -337,11 +337,11 @@ module Axlsx
elsif ext == PNG_EX
PNG_CT
end
- c_types << Axlsx::Default.new(:ContentType => ct, :Extension => ext)
+ c_types << Axlsx::Default.new(ContentType: ct, Extension: ext)
end
if use_shared_strings
- c_types << Axlsx::Override.new(:PartName => "/xl/#{SHARED_STRINGS_PN}",
- :ContentType => SHARED_STRINGS_CT)
+ c_types << Axlsx::Override.new(PartName: "/xl/#{SHARED_STRINGS_PN}",
+ ContentType: SHARED_STRINGS_CT)
end
c_types
end
@@ -351,12 +351,12 @@ module Axlsx
# @private
def base_content_types
c_types = ContentType.new
- c_types << Default.new(:ContentType => RELS_CT, :Extension => RELS_EX)
- c_types << Default.new(:Extension => XML_EX, :ContentType => XML_CT)
- c_types << Override.new(:PartName => "/#{APP_PN}", :ContentType => APP_CT)
- c_types << Override.new(:PartName => "/#{CORE_PN}", :ContentType => CORE_CT)
- c_types << Override.new(:PartName => "/xl/#{STYLES_PN}", :ContentType => STYLES_CT)
- c_types << Axlsx::Override.new(:PartName => "/#{WORKBOOK_PN}", :ContentType => WORKBOOK_CT)
+ c_types << Default.new(ContentType: RELS_CT, Extension: RELS_EX)
+ c_types << Default.new(Extension: XML_EX, ContentType: XML_CT)
+ c_types << Override.new(PartName: "/#{APP_PN}", ContentType: APP_CT)
+ c_types << Override.new(PartName: "/#{CORE_PN}", ContentType: CORE_CT)
+ c_types << Override.new(PartName: "/xl/#{STYLES_PN}", ContentType: STYLES_CT)
+ c_types << Axlsx::Override.new(PartName: "/#{WORKBOOK_PN}", ContentType: WORKBOOK_CT)
c_types.lock
c_types
end
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb
index 5fe7b305..e518d21e 100644
--- a/lib/axlsx/stylesheet/styles.rb
+++ b/lib/axlsx/stylesheet/styles.rb
@@ -267,9 +267,9 @@ module Axlsx
style = case options[:type]
when :dxf
- Dxf.new :fill => fill, :font => font, :numFmt => numFmt, :border => border, :alignment => alignment, :protection => protection
+ Dxf.new fill: fill, font: font, numFmt: numFmt, border: border, alignment: alignment, protection: protection
else
- Xf.new :fillId => fill || 0, :fontId => font || 0, :numFmtId => numFmt || 0, :borderId => border || 0, :alignment => alignment, :protection => protection, :applyFill => !fill.nil?, :applyFont => !font.nil?, :applyNumberFormat => !numFmt.nil?, :applyBorder => !border.nil?, :applyAlignment => !alignment.nil?, :applyProtection => !protection.nil?
+ Xf.new fillId: fill || 0, fontId: font || 0, numFmtId: numFmt || 0, borderId: border || 0, alignment: alignment, protection: protection, applyFill: !fill.nil?, applyFont: !font.nil?, applyNumberFormat: !numFmt.nil?, applyBorder: !border.nil?, applyAlignment: !alignment.nil?, applyProtection: !protection.nil?
end
if options[:type] == :xf
@@ -330,7 +330,7 @@ module Axlsx
options[key.to_sym] = value unless options.key?(key.to_sym)
end
font = Font.new(options)
- font.color = Color.new(:rgb => options[:fg_color]) if options[:fg_color]
+ font.color = Color.new(rgb: options[:fg_color]) if options[:fg_color]
font.name = options[:font_name] if options[:font_name]
options[:type] == :dxf ? font : fonts << font
end
@@ -342,7 +342,7 @@ module Axlsx
def parse_fill_options(options = {})
return unless options[:bg_color]
- color = Color.new(:rgb => options[:bg_color])
+ color = Color.new(rgb: options[:bg_color])
dxf = options[:type] == :dxf
color_key = dxf ? :bgColor : :fgColor
pattern = PatternFill.new(:patternType => :solid, color_key => color)
@@ -445,9 +445,9 @@ module Axlsx
end
border.prs << BorderPr.new({
- :name => edge,
- :style => edge_b_opts[:style],
- :color => Color.new(:rgb => edge_b_opts[:color])
+ name: edge,
+ style: edge_b_opts[:style],
+ color: Color.new(rgb: edge_b_opts[:color])
})
end
end
@@ -471,7 +471,7 @@ module Axlsx
if options[:format_code] || options[:type] == :dxf
# If this is a standard xf we pull from numFmts the highest current and increment for num_fmt
options[:num_fmt] ||= (@numFmts.map(&:numFmtId).max + 1) if options[:type] != :dxf
- numFmt = NumFmt.new(:numFmtId => options[:num_fmt] || 0, :formatCode => options[:format_code].to_s)
+ numFmt = NumFmt.new(numFmtId: options[:num_fmt] || 0, formatCode: options[:format_code].to_s)
options[:type] == :dxf ? numFmt : (numFmts << numFmt; numFmt.numFmtId)
else
options[:num_fmt]
@@ -496,46 +496,46 @@ module Axlsx
# Axlsx::STYLE_THIN_BORDER
def load_default_styles
@numFmts = SimpleTypedList.new NumFmt, 'numFmts'
- @numFmts << NumFmt.new(:numFmtId => NUM_FMT_YYYYMMDD, :formatCode => "yyyy/mm/dd")
- @numFmts << NumFmt.new(:numFmtId => NUM_FMT_YYYYMMDDHHMMSS, :formatCode => "yyyy/mm/dd hh:mm:ss")
+ @numFmts << NumFmt.new(numFmtId: NUM_FMT_YYYYMMDD, formatCode: "yyyy/mm/dd")
+ @numFmts << NumFmt.new(numFmtId: NUM_FMT_YYYYMMDDHHMMSS, formatCode: "yyyy/mm/dd hh:mm:ss")
@numFmts.lock
@fonts = SimpleTypedList.new Font, 'fonts'
- @fonts << Font.new(:name => "Arial", :sz => 11, :family => 1)
+ @fonts << Font.new(name: "Arial", sz: 11, family: 1)
@fonts.lock
@fills = SimpleTypedList.new Fill, 'fills'
- @fills << Fill.new(Axlsx::PatternFill.new(:patternType => :none))
- @fills << Fill.new(Axlsx::PatternFill.new(:patternType => :gray125))
+ @fills << Fill.new(Axlsx::PatternFill.new(patternType: :none))
+ @fills << Fill.new(Axlsx::PatternFill.new(patternType: :gray125))
@fills.lock
@borders = SimpleTypedList.new Border, 'borders'
@borders << Border.new
black_border = Border.new
[:left, :right, :top, :bottom].each do |item|
- black_border.prs << BorderPr.new(:name => item, :style => :thin, :color => Color.new(:rgb => "FF000000"))
+ black_border.prs << BorderPr.new(name: item, style: :thin, color: Color.new(rgb: "FF000000"))
end
@borders << black_border
@borders.lock
@cellStyleXfs = SimpleTypedList.new Xf, "cellStyleXfs"
- @cellStyleXfs << Xf.new(:borderId => 0, :numFmtId => 0, :fontId => 0, :fillId => 0)
+ @cellStyleXfs << Xf.new(borderId: 0, numFmtId: 0, fontId: 0, fillId: 0)
@cellStyleXfs.lock
@cellStyles = SimpleTypedList.new CellStyle, 'cellStyles'
- @cellStyles << CellStyle.new(:name => "Normal", :builtinId => 0, :xfId => 0)
+ @cellStyles << CellStyle.new(name: "Normal", builtinId: 0, xfId: 0)
@cellStyles.lock
@cellXfs = SimpleTypedList.new Xf, "cellXfs"
- @cellXfs << Xf.new(:borderId => 0, :xfId => 0, :numFmtId => 0, :fontId => 0, :fillId => 0)
- @cellXfs << Xf.new(:borderId => 1, :xfId => 0, :numFmtId => 0, :fontId => 0, :fillId => 0)
+ @cellXfs << Xf.new(borderId: 0, xfId: 0, numFmtId: 0, fontId: 0, fillId: 0)
+ @cellXfs << Xf.new(borderId: 1, xfId: 0, numFmtId: 0, fontId: 0, fillId: 0)
# default date formatting
- @cellXfs << Xf.new(:borderId => 0, :xfId => 0, :numFmtId => 14, :fontId => 0, :fillId => 0, :applyNumberFormat => 1)
+ @cellXfs << Xf.new(borderId: 0, xfId: 0, numFmtId: 14, fontId: 0, fillId: 0, applyNumberFormat: 1)
@cellXfs.lock
@dxfs = SimpleTypedList.new(Dxf, "dxfs"); @dxfs.lock
- @tableStyles = TableStyles.new(:defaultTableStyle => "TableStyleMedium9", :defaultPivotStyle => "PivotStyleLight16"); @tableStyles.lock
+ @tableStyles = TableStyles.new(defaultTableStyle: "TableStyleMedium9", defaultPivotStyle: "PivotStyleLight16"); @tableStyles.lock
end
end
end
diff --git a/lib/axlsx/stylesheet/table_style.rb b/lib/axlsx/stylesheet/table_style.rb
index 4423c518..3c3837ea 100644
--- a/lib/axlsx/stylesheet/table_style.rb
+++ b/lib/axlsx/stylesheet/table_style.rb
@@ -44,7 +44,7 @@ module Axlsx
# @return [String]
def to_xml_string(str = +'')
str << '<tableStyle '
- serialized_attributes str, { :count => self.size }
+ serialized_attributes str, { count: self.size }
str << '>'
each { |table_style_el| table_style_el.to_xml_string(str) }
str << '</tableStyle>'
diff --git a/lib/axlsx/stylesheet/table_styles.rb b/lib/axlsx/stylesheet/table_styles.rb
index 49f6e601..38a6eb45 100644
--- a/lib/axlsx/stylesheet/table_styles.rb
+++ b/lib/axlsx/stylesheet/table_styles.rb
@@ -35,7 +35,7 @@ module Axlsx
# @return [String]
def to_xml_string(str = +'')
str << '<tableStyles '
- serialized_attributes str, { :count => self.size }
+ serialized_attributes str, { count: self.size }
str << '>'
each { |table_style| table_style.to_xml_string(str) }
str << '</tableStyles>'
diff --git a/lib/axlsx/util/storage.rb b/lib/axlsx/util/storage.rb
index 00cd6b3c..b33c499d 100644
--- a/lib/axlsx/util/storage.rb
+++ b/lib/axlsx/util/storage.rb
@@ -9,9 +9,9 @@ module Axlsx
# storage types
TYPES = {
- :root => 5,
- :stream => 2,
- :storage => 1
+ root: 5,
+ stream: 2,
+ storage: 1
}.freeze
# Creates a byte string for this storage
@@ -33,8 +33,8 @@ module Axlsx
# storage colors
COLORS = {
- :red => 0,
- :black => 1
+ red: 0,
+ black: 1
}.freeze
# The color of this node in the directory tree. Defaults to black if not specified
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb
index b4f826c2..f651e3cb 100644
--- a/lib/axlsx/workbook/worksheet/cell.rb
+++ b/lib/axlsx/workbook/worksheet/cell.rb
@@ -299,7 +299,7 @@ module Axlsx
# @param [String] v The 8 character representation for an rgb color #FFFFFFFF"
def color=(v)
- @color = v.is_a?(Color) ? v : Color.new(:rgb => v)
+ @color = v.is_a?(Color) ? v : Color.new(rgb: v)
@is_text_run = true
end
diff --git a/lib/axlsx/workbook/worksheet/col_breaks.rb b/lib/axlsx/workbook/worksheet/col_breaks.rb
index 58fe9e10..cc7d6abb 100644
--- a/lib/axlsx/workbook/worksheet/col_breaks.rb
+++ b/lib/axlsx/workbook/worksheet/col_breaks.rb
@@ -16,7 +16,7 @@ module Axlsx
# Break will be passed to the created break object.
# @see Break
def add_break(options)
- self << Break.new(options.merge(:max => 1048575, :man => true))
+ self << Break.new(options.merge(max: 1048575, man: true))
last
end
diff --git a/lib/axlsx/workbook/worksheet/color_scale.rb b/lib/axlsx/workbook/worksheet/color_scale.rb
index fb84668b..e48de3bb 100644
--- a/lib/axlsx/workbook/worksheet/color_scale.rb
+++ b/lib/axlsx/workbook/worksheet/color_scale.rb
@@ -12,8 +12,8 @@ module Axlsx
# These are the default conditional formatting value objects
# that define a two tone color gradient.
def default_cfvos
- [{ :type => :min, :val => 0, :color => 'FFFF7128' },
- { :type => :max, :val => 0, :color => 'FFFFEF9C' }]
+ [{ type: :min, val: 0, color: 'FFFF7128' },
+ { type: :max, val: 0, color: 'FFFFEF9C' }]
end
# A builder for two tone color gradient
@@ -31,9 +31,9 @@ module Axlsx
# color_scale = Axlsx::ColorScale.three_tone
# @see examples/example.rb conditional formatting examples.
def three_tone
- self.new({ :type => :min, :val => 0, :color => 'FFF8696B' },
- { :type => :percent, :val => '50', :color => 'FFFFEB84' },
- { :type => :max, :val => 0, :color => 'FF63BE7B' })
+ self.new({ type: :min, val: 0, color: 'FFF8696B' },
+ { type: :percent, val: '50', color: 'FFFFEB84' },
+ { type: :max, val: 0, color: 'FF63BE7B' })
end
end
# A simple typed list of cfvos
@@ -68,9 +68,9 @@ module Axlsx
# @option [Any] val The value of the cfvo to add
# @option [String] The rgb color for the cfvo
def add(options = {})
- value_objects << Cfvo.new(:type => options[:type] || :min, :val => options[:val] || 0)
- colors << Color.new(:rgb => options[:color] || "FF000000")
- { :cfvo => value_objects.last, :color => colors.last }
+ value_objects << Cfvo.new(type: options[:type] || :min, val: options[:val] || 0)
+ colors << Color.new(rgb: options[:color] || "FF000000")
+ { cfvo: value_objects.last, color: colors.last }
end
# removes the cfvo and color pair at the index specified.
diff --git a/lib/axlsx/workbook/worksheet/comment.rb b/lib/axlsx/workbook/worksheet/comment.rb
index ea8324d0..879e6960 100644
--- a/lib/axlsx/workbook/worksheet/comment.rb
+++ b/lib/axlsx/workbook/worksheet/comment.rb
@@ -81,7 +81,7 @@ module Axlsx
# by default, all columns are 5 columns wide and 5 rows high
def initialize_vml_shape
pos = Axlsx::name_to_indices(ref)
- @vml_shape = VmlShape.new(:row => pos[1], :column => pos[0], :visible => @visible) do |vml|
+ @vml_shape = VmlShape.new(row: pos[1], column: pos[0], visible: @visible) do |vml|
vml.left_column = vml.column
vml.right_column = vml.column + 2
vml.top_row = vml.row
diff --git a/lib/axlsx/workbook/worksheet/data_bar.rb b/lib/axlsx/workbook/worksheet/data_bar.rb
index 0dcdc8a8..74158d98 100644
--- a/lib/axlsx/workbook/worksheet/data_bar.rb
+++ b/lib/axlsx/workbook/worksheet/data_bar.rb
@@ -14,8 +14,8 @@ module Axlsx
class << self
# This differs from ColorScale. There must be exactly two cfvos one color
def default_cfvos
- [{ :type => :min, :val => "0" },
- { :type => :max, :val => "0" }]
+ [{ type: :min, val: "0" },
+ { type: :max, val: "0" }]
end
end
@@ -72,7 +72,7 @@ module Axlsx
# the color object used in the data bar formatting
# @return [Color]
def color
- @color ||= Color.new :rgb => "FF0000FF"
+ @color ||= Color.new rgb: "FF0000FF"
end
# @see minLength
diff --git a/lib/axlsx/workbook/worksheet/icon_set.rb b/lib/axlsx/workbook/worksheet/icon_set.rb
index c4b5f2ff..59d67e28 100644
--- a/lib/axlsx/workbook/worksheet/icon_set.rb
+++ b/lib/axlsx/workbook/worksheet/icon_set.rb
@@ -75,7 +75,7 @@ module Axlsx
# I am keeping this private for now as I am not sure what impact changes to the required two cfvo objects will do.
def initialize_value_objects
@value_objects = SimpleTypedList.new Cfvo
- @value_objects.concat [Cfvo.new(:type => :percent, :val => 0), Cfvo.new(:type => :percent, :val => 33), Cfvo.new(:type => :percent, :val => 67)]
+ @value_objects.concat [Cfvo.new(type: :percent, val: 0), Cfvo.new(type: :percent, val: 33), Cfvo.new(type: :percent, val: 67)]
@value_objects.lock
end
end
diff --git a/lib/axlsx/workbook/worksheet/pivot_table.rb b/lib/axlsx/workbook/worksheet/pivot_table.rb
index 44a50f19..a75842cd 100644
--- a/lib/axlsx/workbook/worksheet/pivot_table.rb
+++ b/lib/axlsx/workbook/worksheet/pivot_table.rb
@@ -124,7 +124,7 @@ module Axlsx
@data = []
v.each do |data_field|
if data_field.is_a? String
- data_field = { :ref => data_field }
+ data_field = { ref: data_field }
end
data_field.each do |key, value|
if key == :num_fmt
diff --git a/lib/axlsx/workbook/worksheet/protected_ranges.rb b/lib/axlsx/workbook/worksheet/protected_ranges.rb
index f8ce82c5..b425d053 100644
--- a/lib/axlsx/workbook/worksheet/protected_ranges.rb
+++ b/lib/axlsx/workbook/worksheet/protected_ranges.rb
@@ -21,7 +21,7 @@ module Axlsx
elsif cells.is_a?(SimpleTypedList) || cells.is_a?(Array)
Axlsx::cell_range(cells, false)
end
- self << ProtectedRange.new(:sqref => sqref, :name => "Range#{size}")
+ self << ProtectedRange.new(sqref: sqref, name: "Range#{size}")
last
end
diff --git a/lib/axlsx/workbook/worksheet/rich_text_run.rb b/lib/axlsx/workbook/worksheet/rich_text_run.rb
index e3522d4c..9f66959a 100644
--- a/lib/axlsx/workbook/worksheet/rich_text_run.rb
+++ b/lib/axlsx/workbook/worksheet/rich_text_run.rb
@@ -140,7 +140,7 @@ module Axlsx
# @param [String] v The 8 character representation for an rgb color #FFFFFFFF"
def color=(v)
- @color = v.is_a?(Color) ? v : Color.new(:rgb => v)
+ @color = v.is_a?(Color) ? v : Color.new(rgb: v)
end
# The inline sz property for the cell
diff --git a/lib/axlsx/workbook/worksheet/row.rb b/lib/axlsx/workbook/worksheet/row.rb
index dc0320b7..0b25fc59 100644
--- a/lib/axlsx/workbook/worksheet/row.rb
+++ b/lib/axlsx/workbook/worksheet/row.rb
@@ -89,7 +89,7 @@ module Axlsx
# @param [String] str The string this rows xml will be appended to.
# @return [String]
def to_xml_string(r_index, str = +'')
- serialized_tag('row', str, :r => Axlsx.row_ref(r_index)) do
+ serialized_tag('row', str, r: Axlsx.row_ref(r_index)) do
each_with_index { |cell, c_index| cell.to_xml_string(r_index, c_index, str) }
end
end
diff --git a/lib/axlsx/workbook/worksheet/row_breaks.rb b/lib/axlsx/workbook/worksheet/row_breaks.rb
index 21691f7a..381dc0b6 100644
--- a/lib/axlsx/workbook/worksheet/row_breaks.rb
+++ b/lib/axlsx/workbook/worksheet/row_breaks.rb
@@ -14,7 +14,7 @@ module Axlsx
# @see Break
def add_break(options)
# force feed the Excel default
- self << Break.new(options.merge(:max => 16383, :man => true))
+ self << Break.new(options.merge(max: 16383, man: true))
last
end
diff --git a/lib/axlsx/workbook/worksheet/sheet_pr.rb b/lib/axlsx/workbook/worksheet/sheet_pr.rb
index ea191fa0..0676170e 100644
--- a/lib/axlsx/workbook/worksheet/sheet_pr.rb
+++ b/lib/axlsx/workbook/worksheet/sheet_pr.rb
@@ -75,7 +75,7 @@ module Axlsx
# @see tab_color
def tab_color=(v)
- @tab_color = Color.new(:rgb => v)
+ @tab_color = Color.new(rgb: v)
end
private
diff --git a/lib/axlsx/workbook/worksheet/sheet_view.rb b/lib/axlsx/workbook/worksheet/sheet_view.rb
index b64920bb..6138cbf7 100644
--- a/lib/axlsx/workbook/worksheet/sheet_view.rb
+++ b/lib/axlsx/workbook/worksheet/sheet_view.rb
@@ -158,7 +158,7 @@ module Axlsx
# param [Hash] options
# return [Selection]
def add_selection(pane, options = {})
- @selections[pane] = Selection.new(options.merge(:pane => pane))
+ @selections[pane] = Selection.new(options.merge(pane: pane))
end
# @see color_id
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb
index 1ece3138..90461c66 100644
--- a/lib/axlsx/workbook/worksheet/worksheet.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet.rb
@@ -448,7 +448,7 @@ module Axlsx
# @see ConditionalFormattingRule#initialize
# @see file:examples/example_conditional_formatting.rb
def add_conditional_formatting(cells, rules)
- cf = ConditionalFormatting.new(:sqref => cells)
+ cf = ConditionalFormatting.new(sqref: cells)
cf.add_rules rules
conditional_formattings << cf
conditional_formattings
@@ -531,9 +531,9 @@ module Axlsx
cell.pos
end
if column_index > 0
- col_breaks.add_break(:id => column_index)
+ col_breaks.add_break(id: column_index)
end
- row_breaks.add_break(:id => row_index)
+ row_breaks.add_break(id: row_index)
end
# This is a helper method that Lets you specify a fixed width for multiple columns in a worksheet in one go.
diff --git a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
index c4cb8983..80f7ba09 100644
--- a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb
@@ -52,7 +52,7 @@ module Axlsx
def relationship
return unless @target == :external
- Relationship.new(self, HYPERLINK_R, location, :target_mode => :External)
+ Relationship.new(self, HYPERLINK_R, location, target_mode: :External)
end
# Seralize the object
@@ -69,7 +69,7 @@ module Axlsx
# r:id should only be specified for external targets.
# @return [Hash]
def location_or_id
- @target == :external ? { :"r:id" => relationship.Id } : { :location => Axlsx::coder.encode(location) }
+ @target == :external ? { "r:id": relationship.Id } : { location: Axlsx::coder.encode(location) }
end
end
end