xlsxrb 0.1.18 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +200 -0
  3. data/README.md +35 -12
  4. data/lib/ruby_lsp/xlsxrb/completion_listener.rb +410 -80
  5. data/lib/xlsxrb/chart_builder.rb +251 -386
  6. data/lib/xlsxrb/dsl_helpers.rb +169 -68
  7. data/lib/xlsxrb/elements/cell.rb +37 -157
  8. data/lib/xlsxrb/elements/column.rb +11 -19
  9. data/lib/xlsxrb/elements/coordinate_access.rb +15 -86
  10. data/lib/xlsxrb/elements/image.rb +5 -72
  11. data/lib/xlsxrb/elements/metadata.rb +463 -817
  12. data/lib/xlsxrb/elements/row.rb +27 -145
  13. data/lib/xlsxrb/elements/styles.rb +30 -88
  14. data/lib/xlsxrb/elements/types.rb +6 -99
  15. data/lib/xlsxrb/elements/workbook.rb +19 -126
  16. data/lib/xlsxrb/elements/worksheet.rb +45 -316
  17. data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +4 -1
  18. data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +7 -7
  19. data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +32 -17
  20. data/lib/xlsxrb/ooxml/reader.rb +49 -51
  21. data/lib/xlsxrb/ooxml/styles_parser.rb +26 -2
  22. data/lib/xlsxrb/ooxml/utils.rb +15 -2
  23. data/lib/xlsxrb/ooxml/workbook_parser.rb +0 -1
  24. data/lib/xlsxrb/ooxml/workbook_writer.rb +184 -94
  25. data/lib/xlsxrb/ooxml/worksheet_parser.rb +61 -29
  26. data/lib/xlsxrb/ooxml/worksheet_writer.rb +353 -261
  27. data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +28 -11
  28. data/lib/xlsxrb/ooxml/writer/features_xml.rb +62 -16
  29. data/lib/xlsxrb/ooxml/writer/styles_xml.rb +1 -1
  30. data/lib/xlsxrb/ooxml/writer.rb +106 -42
  31. data/lib/xlsxrb/ooxml/xml_builder.rb +18 -0
  32. data/lib/xlsxrb/ooxml/xml_parser.rb +78 -5
  33. data/lib/xlsxrb/ooxml/zip_reader.rb +65 -15
  34. data/lib/xlsxrb/ooxml/zip_writer.rb +119 -30
  35. data/lib/xlsxrb/stream_row.rb +14 -118
  36. data/lib/xlsxrb/stream_sheet.rb +14 -261
  37. data/lib/xlsxrb/stream_writer.rb +807 -1537
  38. data/lib/xlsxrb/style_builder.rb +715 -593
  39. data/lib/xlsxrb/version.rb +1 -1
  40. data/lib/xlsxrb/workbook_builder.rb +403 -286
  41. data/lib/xlsxrb/worksheet_builder.rb +1297 -1458
  42. data/lib/xlsxrb.rb +281 -1079
  43. data/sig/generated/xlsxrb/chart_builder.rbs +202 -205
  44. data/sig/generated/xlsxrb/dsl_helpers.rbs +92 -16
  45. data/sig/generated/xlsxrb/elements/cell.rbs +12 -76
  46. data/sig/generated/xlsxrb/elements/column.rbs +0 -7
  47. data/sig/generated/xlsxrb/elements/coordinate_access.rbs +5 -41
  48. data/sig/generated/xlsxrb/elements/image.rbs +3 -29
  49. data/sig/generated/xlsxrb/elements/metadata.rbs +138 -151
  50. data/sig/generated/xlsxrb/elements/row.rbs +10 -53
  51. data/sig/generated/xlsxrb/elements/styles.rbs +1 -39
  52. data/sig/generated/xlsxrb/elements/workbook.rbs +14 -78
  53. data/sig/generated/xlsxrb/elements/worksheet.rbs +5 -121
  54. data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +0 -4
  55. data/sig/generated/xlsxrb/ooxml/reader.rbs +0 -3
  56. data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +1 -1
  57. data/sig/generated/xlsxrb/ooxml/utils.rbs +13 -3
  58. data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +17 -0
  59. data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +16 -0
  60. data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +58 -3
  61. data/sig/generated/xlsxrb/ooxml/writer/features_xml.rbs +10 -0
  62. data/sig/generated/xlsxrb/ooxml/writer.rbs +20 -14
  63. data/sig/generated/xlsxrb/ooxml/xml_builder.rbs +12 -0
  64. data/sig/generated/xlsxrb/ooxml/xml_parser.rbs +70 -0
  65. data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +22 -7
  66. data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +26 -1
  67. data/sig/generated/xlsxrb/stream_row.rbs +9 -44
  68. data/sig/generated/xlsxrb/stream_sheet.rbs +1 -158
  69. data/sig/generated/xlsxrb/stream_writer.rbs +491 -974
  70. data/sig/generated/xlsxrb/style_builder.rbs +464 -239
  71. data/sig/generated/xlsxrb/workbook_builder.rbs +124 -139
  72. data/sig/generated/xlsxrb/worksheet_builder.rbs +922 -686
  73. data/sig/generated/xlsxrb.rbs +56 -188
  74. data/sig/rexml.rbs +8 -0
  75. metadata +3 -5
  76. data/lib/xlsxrb/utils.rb +0 -251
  77. data/sig/generated/xlsxrb/utils.rbs +0 -200
@@ -7,12 +7,12 @@ module Xlsxrb
7
7
  #
8
8
  # @example Create a chart definition
9
9
  # builder = ChartBuilder.new
10
- # builder.type(:bar)
11
- # builder.title("Quarterly Sales")
10
+ # builder.type = :bar
11
+ # builder.title = "Quarterly Sales"
12
12
  # builder.series do |s|
13
- # s.name("2026")
14
- # s.categories("Sheet1!$A$2:$A$5")
15
- # s.values("Sheet1!$B$2:$B$5")
13
+ # s.name = "2026"
14
+ # s.categories = "Sheet1!$A$2:$A$5"
15
+ # s.values = "Sheet1!$B$2:$B$5"
16
16
  # end
17
17
  #
18
18
  # @api public
@@ -27,20 +27,13 @@ module Xlsxrb
27
27
  #: Hash[Symbol, untyped]
28
28
  attr_reader :options
29
29
 
30
- # Sets or gets the chart type (e.g. :line, :bar, :pie, :area, :radar, :scatter).
30
+ # Gets the chart type (e.g. :line, :bar, :pie, :area, :radar, :scatter).
31
31
  #
32
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#type=} instead.
33
- # @param value [Symbol, String, nil] Chart type.
34
32
  # @return [Symbol, String, nil]
35
33
  # @api public
36
- #: (?Symbol | String | nil value) -> (Symbol | String | nil)
37
- def type(value = nil)
38
- if value.nil?
39
- @options[:type]
40
- else
41
- warn "[Xlsxrb DEPRECATION] ChartBuilder#type(value) is deprecated; use #type= instead.", uplevel: 1
42
- @options[:type] = value
43
- end
34
+ #: () -> (Symbol | String | nil)
35
+ def type
36
+ @options[:type]
44
37
  end
45
38
 
46
39
  # Sets the chart type.
@@ -53,45 +46,51 @@ module Xlsxrb
53
46
  @options[:type] = value
54
47
  end
55
48
 
56
- # Sets or gets the chart title.
49
+ # Gets or configures the chart title.
57
50
  #
58
- # @param value [String, Hash, nil] Chart title text or options hash.
59
- # @param kwargs [Hash] Keyword arguments for title styling.
60
- # @return [String, Hash, nil]
51
+ # @overload title
52
+ # Returns the configured title options or text.
53
+ # @return [String, Hash{Symbol => Object}, nil]
54
+ # @overload title(**kwargs)
55
+ # Configures title using keyword arguments.
56
+ # @return [void]
61
57
  # @api public
62
- #: (?String | Hash[Symbol, untyped] | nil value, **untyped kwargs) -> (String | Hash[Symbol, untyped] | nil)
63
- def title(value = nil, **kwargs)
64
- if !kwargs.empty?
58
+ #: (**untyped kwargs) -> (String | Hash[Symbol, untyped] | nil)
59
+ def title(**kwargs)
60
+ if kwargs.empty?
61
+ @options[:title]
62
+ else
65
63
  @options[:title] = kwargs
66
64
  nil
67
- elsif !value.nil?
68
- warn "[Xlsxrb DEPRECATION] ChartBuilder#title(value) is deprecated; use #title= or #title(**kwargs) instead.", uplevel: 1
69
- @options[:title] = value
70
- else
71
- @options[:title]
72
65
  end
73
66
  end
74
67
 
75
68
  # Sets the chart title.
76
69
  #
77
- # @param value [String, Hash, nil]
78
- # @return [String, Hash, nil]
70
+ # @param value [String, Hash{Symbol => Object}, nil]
71
+ # @return [String, Hash{Symbol => Object}, nil]
79
72
  # @api public
80
73
  #: (String | Hash[Symbol, untyped] | nil value) -> (String | Hash[Symbol, untyped] | nil)
81
74
  def title=(value)
82
75
  @options[:title] = value
83
76
  end
84
77
 
85
- # Adds a data series to the chart.
78
+ # Adds a data series to the chart or returns the configured series list.
86
79
  #
87
- # @param value [Hash{Symbol => Object}, Array, nil] Series options hash or array.
88
- # @param kwargs [Hash] Keyword arguments for series configuration.
89
- # @yield [series_builder]
90
- # @yieldparam series_builder [SeriesBuilder]
91
- # @return [Array<Hash{Symbol => Object}>, nil]
80
+ # @overload series
81
+ # Returns the configured series options list.
82
+ # @return [Array<Hash{Symbol => Object}>]
83
+ # @overload series(**kwargs)
84
+ # Adds a series configured via keyword arguments.
85
+ # @return [void]
86
+ # @overload series(&block)
87
+ # Configures a series using a block.
88
+ # @yield [series_builder]
89
+ # @yieldparam series_builder [SeriesBuilder]
90
+ # @return [void]
92
91
  # @api public
93
- #: (?Hash[Symbol, untyped] | Array[Hash[Symbol, untyped]] | nil value, **untyped kwargs) ?{ (SeriesBuilder) -> void } -> (Array[Hash[Symbol, untyped]] | nil)
94
- def series(value = nil, **kwargs, &)
92
+ #: (**untyped kwargs) ?{ (SeriesBuilder) -> void } -> (Array[Hash[Symbol, untyped]] | nil)
93
+ def series(**kwargs, &)
95
94
  if block_given?
96
95
  sb = SeriesBuilder.new
97
96
  yield sb
@@ -100,15 +99,8 @@ module Xlsxrb
100
99
  elsif !kwargs.empty?
101
100
  (@options[:series] ||= []) << kwargs
102
101
  nil
103
- elsif !value.nil?
104
- warn "[Xlsxrb DEPRECATION] ChartBuilder#series(value) with positional argument is deprecated; use #series=, #series(**kwargs), or #series(&block) instead.", uplevel: 1
105
- if value.is_a?(Array)
106
- (@options[:series] ||= []).concat(value)
107
- else
108
- (@options[:series] ||= []) << value
109
- end
110
102
  else
111
- @options[:series] ||= []
103
+ @options[:series] || []
112
104
  end
113
105
  end
114
106
 
@@ -122,22 +114,22 @@ module Xlsxrb
122
114
  @options[:series] = value.is_a?(Array) ? value : [value]
123
115
  end
124
116
 
125
- # Configures the legend property for this chart.
117
+ # Gets or configures the legend property for this chart.
126
118
  #
127
- # @param args [Array] Positional arguments (e.g. position string).
128
- # @param kwargs [Hash] Keyword arguments for legend styling/layout.
129
- # @return [Object] The configured legend property.
119
+ # @overload legend
120
+ # Returns the configured legend property.
121
+ # @return [Object]
122
+ # @overload legend(**kwargs)
123
+ # Configures legend using keyword arguments.
124
+ # @return [void]
130
125
  # @api public
131
- #: (*(Hash[Symbol, untyped] | String | Symbol) args, **untyped kwargs) -> untyped
132
- def legend(*args, **kwargs)
133
- if !args.empty?
134
- warn "[Xlsxrb DEPRECATION] ChartBuilder#legend(options) with positional argument is deprecated; use #legend= or #legend(**kwargs) instead.", uplevel: 1
135
- @options[:legend] = args.first
136
- elsif !kwargs.empty?
126
+ #: (**untyped kwargs) -> untyped
127
+ def legend(**kwargs)
128
+ if kwargs.empty?
129
+ @options[:legend]
130
+ else
137
131
  @options[:legend] = kwargs
138
132
  nil
139
- else
140
- @options[:legend]
141
133
  end
142
134
  end
143
135
 
@@ -151,22 +143,22 @@ module Xlsxrb
151
143
  @options[:legend] = value
152
144
  end
153
145
 
154
- # Configures the plot_area property for this chart.
146
+ # Gets or configures the plot_area property for this chart.
155
147
  #
156
- # @param args [Array] Positional arguments.
157
- # @param kwargs [Hash] Keyword arguments for plot area configuration.
158
- # @return [Object] The configured plot_area property.
148
+ # @overload plot_area
149
+ # Returns the configured plot_area property.
150
+ # @return [Object]
151
+ # @overload plot_area(**kwargs)
152
+ # Configures plot_area using keyword arguments.
153
+ # @return [void]
159
154
  # @api public
160
- #: (*(Hash[Symbol, String | Numeric | bool | nil] | String) args, **String | Numeric | bool | nil kwargs) -> untyped
161
- def plot_area(*args, **kwargs)
162
- if !args.empty?
163
- warn "[Xlsxrb DEPRECATION] ChartBuilder#plot_area(options) with positional argument is deprecated; use #plot_area= or #plot_area(**kwargs) instead.", uplevel: 1
164
- @options[:plot_area] = args.first
165
- elsif !kwargs.empty?
155
+ #: (**untyped kwargs) -> untyped
156
+ def plot_area(**kwargs)
157
+ if kwargs.empty?
158
+ @options[:plot_area]
159
+ else
166
160
  @options[:plot_area] = kwargs
167
161
  nil
168
- else
169
- @options[:plot_area]
170
162
  end
171
163
  end
172
164
 
@@ -180,22 +172,22 @@ module Xlsxrb
180
172
  @options[:plot_area] = value
181
173
  end
182
174
 
183
- # Configures the chart_space property for this chart.
175
+ # Gets or configures the chart_space property for this chart.
184
176
  #
185
- # @param args [Array] Positional arguments.
186
- # @param kwargs [Hash] Keyword arguments.
187
- # @return [Object] The configured chart_space property.
177
+ # @overload chart_space
178
+ # Returns the configured chart_space property.
179
+ # @return [Object]
180
+ # @overload chart_space(**kwargs)
181
+ # Configures chart_space using keyword arguments.
182
+ # @return [void]
188
183
  # @api public
189
- #: (*(Hash[Symbol, String | Numeric | bool | nil] | String) args, **String | Numeric | bool | nil kwargs) -> untyped
190
- def chart_space(*args, **kwargs)
191
- if !args.empty?
192
- warn "[Xlsxrb DEPRECATION] ChartBuilder#chart_space(options) with positional argument is deprecated; use #chart_space= or #chart_space(**kwargs) instead.", uplevel: 1
193
- @options[:chart_space] = args.first
194
- elsif !kwargs.empty?
184
+ #: (**untyped kwargs) -> untyped
185
+ def chart_space(**kwargs)
186
+ if kwargs.empty?
187
+ @options[:chart_space]
188
+ else
195
189
  @options[:chart_space] = kwargs
196
190
  nil
197
- else
198
- @options[:chart_space]
199
191
  end
200
192
  end
201
193
 
@@ -209,20 +201,13 @@ module Xlsxrb
209
201
  @options[:chart_space] = value
210
202
  end
211
203
 
212
- # Configures the style index/id for this chart.
204
+ # Gets the style index/id for this chart.
213
205
  #
214
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#style=} instead.
215
- # @param value [Object, nil]
216
- # @return [Object] The configured style property.
206
+ # @return [Integer, String, Hash, nil] The configured style property.
217
207
  # @api public
218
- #: (?untyped value) -> untyped
219
- def style(value = nil)
220
- if value.nil?
221
- @options[:style]
222
- else
223
- warn "[Xlsxrb DEPRECATION] ChartBuilder#style(value) is deprecated; use #style= instead.", uplevel: 1
224
- @options[:style] = value
225
- end
208
+ #: () -> untyped
209
+ def style
210
+ @options[:style]
226
211
  end
227
212
 
228
213
  # Sets the style property.
@@ -235,22 +220,22 @@ module Xlsxrb
235
220
  @options[:style] = value
236
221
  end
237
222
 
238
- # Configures data labels for this chart.
223
+ # Gets or configures data labels for this chart.
239
224
  #
240
- # @param args [Array] Positional arguments.
241
- # @param kwargs [Hash] Keyword arguments.
242
- # @return [Object] The configured data_labels property.
225
+ # @overload data_labels
226
+ # Returns the configured data_labels property.
227
+ # @return [Object]
228
+ # @overload data_labels(**kwargs)
229
+ # Configures data_labels using keyword arguments.
230
+ # @return [void]
243
231
  # @api public
244
- #: (*(Hash[Symbol, String | Numeric | bool | nil] | String) args, **String | Numeric | bool | nil kwargs) -> untyped
245
- def data_labels(*args, **kwargs)
246
- if !args.empty?
247
- warn "[Xlsxrb DEPRECATION] ChartBuilder#data_labels(options) with positional argument is deprecated; use #data_labels= or #data_labels(**kwargs) instead.", uplevel: 1
248
- @options[:data_labels] = args.first
249
- elsif !kwargs.empty?
232
+ #: (**untyped kwargs) -> untyped
233
+ def data_labels(**kwargs)
234
+ if kwargs.empty?
235
+ @options[:data_labels]
236
+ else
250
237
  @options[:data_labels] = kwargs
251
238
  nil
252
- else
253
- @options[:data_labels]
254
239
  end
255
240
  end
256
241
 
@@ -264,20 +249,13 @@ module Xlsxrb
264
249
  @options[:data_labels] = value
265
250
  end
266
251
 
267
- # Configures whether to plot visible cells only.
252
+ # Returns whether to plot visible cells only.
268
253
  #
269
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#plot_visible_only=} instead.
270
- # @param value [Boolean, String, nil]
271
- # @return [Boolean, String]
254
+ # @return [Boolean]
272
255
  # @api public
273
- #: (?untyped value) -> untyped
274
- def plot_visible_only(value = nil)
275
- if value.nil?
276
- @options[:plot_visible_only]
277
- else
278
- warn "[Xlsxrb DEPRECATION] ChartBuilder#plot_visible_only(value) is deprecated; use #plot_visible_only= instead.", uplevel: 1
279
- @options[:plot_visible_only] = value
280
- end
256
+ #: () -> bool
257
+ def plot_visible_only?
258
+ @options[:plot_visible_only] ? true : false
281
259
  end
282
260
 
283
261
  # Sets whether to plot visible cells only.
@@ -285,25 +263,18 @@ module Xlsxrb
285
263
  # @param value [Boolean, nil]
286
264
  # @return [Boolean, nil]
287
265
  # @api public
288
- #: (untyped value) -> untyped
266
+ #: (bool? value) -> bool?
289
267
  def plot_visible_only=(value)
290
268
  @options[:plot_visible_only] = value
291
269
  end
292
270
 
293
- # Configures how blank cells are displayed in the chart.
271
+ # Gets how blank cells are displayed in the chart.
294
272
  #
295
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#display_blanks_as=} instead.
296
- # @param value [String, nil]
297
- # @return [String]
273
+ # @return [String, nil]
298
274
  # @api public
299
- #: (?untyped value) -> untyped
300
- def display_blanks_as(value = nil)
301
- if value.nil?
302
- @options[:display_blanks_as]
303
- else
304
- warn "[Xlsxrb DEPRECATION] ChartBuilder#display_blanks_as(value) is deprecated; use #display_blanks_as= instead.", uplevel: 1
305
- @options[:display_blanks_as] = value
306
- end
275
+ #: () -> String?
276
+ def display_blanks_as
277
+ @options[:display_blanks_as]
307
278
  end
308
279
 
309
280
  # Sets display blanks as mode.
@@ -311,27 +282,27 @@ module Xlsxrb
311
282
  # @param value [String, nil]
312
283
  # @return [String, nil]
313
284
  # @api public
314
- #: (untyped value) -> untyped
285
+ #: (String? value) -> String?
315
286
  def display_blanks_as=(value)
316
287
  @options[:display_blanks_as] = value
317
288
  end
318
289
 
319
- # Configures 3D view properties for 3D charts.
290
+ # Gets or configures 3D view properties for 3D charts.
320
291
  #
321
- # @param args [Array] Positional arguments.
322
- # @param kwargs [Hash] Keyword arguments.
323
- # @return [Object]
292
+ # @overload view3d
293
+ # Returns the configured view3d property.
294
+ # @return [Object]
295
+ # @overload view3d(**kwargs)
296
+ # Configures view3d using keyword arguments.
297
+ # @return [void]
324
298
  # @api public
325
- #: (*(Hash[Symbol, String | Numeric | bool | nil] | String) args, **String | Numeric | bool | nil kwargs) -> untyped
326
- def view3d(*args, **kwargs)
327
- if !args.empty?
328
- warn "[Xlsxrb DEPRECATION] ChartBuilder#view3d(options) with positional argument is deprecated; use #view3d= or #view3d(**kwargs) instead.", uplevel: 1
329
- @options[:view3d] = args.first
330
- elsif !kwargs.empty?
299
+ #: (**untyped kwargs) -> untyped
300
+ def view3d(**kwargs)
301
+ if kwargs.empty?
302
+ @options[:view3d]
303
+ else
331
304
  @options[:view3d] = kwargs
332
305
  nil
333
- else
334
- @options[:view3d]
335
306
  end
336
307
  end
337
308
 
@@ -345,22 +316,22 @@ module Xlsxrb
345
316
  @options[:view3d] = value
346
317
  end
347
318
 
348
- # Configures the category axis properties for this chart.
319
+ # Gets or configures the category axis properties for this chart.
349
320
  #
350
- # @param args [Array] Positional arguments.
351
- # @param kwargs [Hash] Keyword arguments.
352
- # @return [Object] The configured category axis property.
321
+ # @overload category_axis
322
+ # Returns the configured category axis property.
323
+ # @return [Object]
324
+ # @overload category_axis(**kwargs)
325
+ # Configures category axis using keyword arguments.
326
+ # @return [void]
353
327
  # @api public
354
- #: (*(Hash[Symbol, String | Numeric | bool | nil] | String) args, **String | Numeric | bool | nil kwargs) -> untyped
355
- def category_axis(*args, **kwargs)
356
- if !args.empty?
357
- warn "[Xlsxrb DEPRECATION] ChartBuilder#category_axis(options) with positional argument is deprecated; use #category_axis= or #category_axis(**kwargs) instead.", uplevel: 1
358
- @options[:category_axis] = args.first
359
- elsif !kwargs.empty?
328
+ #: (**untyped kwargs) -> untyped
329
+ def category_axis(**kwargs)
330
+ if kwargs.empty?
331
+ @options[:category_axis]
332
+ else
360
333
  @options[:category_axis] = kwargs
361
334
  nil
362
- else
363
- @options[:category_axis]
364
335
  end
365
336
  end
366
337
 
@@ -374,22 +345,22 @@ module Xlsxrb
374
345
  @options[:category_axis] = value
375
346
  end
376
347
 
377
- # Configures the value axis properties for this chart.
348
+ # Gets or configures the value axis properties for this chart.
378
349
  #
379
- # @param args [Array] Positional arguments.
380
- # @param kwargs [Hash] Keyword arguments.
381
- # @return [Object] The configured value axis property.
350
+ # @overload value_axis
351
+ # Returns the configured value axis property.
352
+ # @return [Object]
353
+ # @overload value_axis(**kwargs)
354
+ # Configures value axis using keyword arguments.
355
+ # @return [void]
382
356
  # @api public
383
- #: (*(Hash[Symbol, String | Numeric | bool | nil] | String) args, **String | Numeric | bool | nil kwargs) -> untyped
384
- def value_axis(*args, **kwargs)
385
- if !args.empty?
386
- warn "[Xlsxrb DEPRECATION] ChartBuilder#value_axis(options) with positional argument is deprecated; use #value_axis= or #value_axis(**kwargs) instead.", uplevel: 1
387
- @options[:value_axis] = args.first
388
- elsif !kwargs.empty?
357
+ #: (**untyped kwargs) -> untyped
358
+ def value_axis(**kwargs)
359
+ if kwargs.empty?
360
+ @options[:value_axis]
361
+ else
389
362
  @options[:value_axis] = kwargs
390
363
  nil
391
- else
392
- @options[:value_axis]
393
364
  end
394
365
  end
395
366
 
@@ -403,22 +374,22 @@ module Xlsxrb
403
374
  @options[:value_axis] = value
404
375
  end
405
376
 
406
- # Configures the secondary value axis properties for combo charts.
377
+ # Gets or configures the secondary value axis properties for combo charts.
407
378
  #
408
- # @param args [Array] Positional arguments.
409
- # @param kwargs [Hash] Keyword arguments.
410
- # @return [Object]
379
+ # @overload secondary_value_axis
380
+ # Returns the configured secondary value axis property.
381
+ # @return [Object]
382
+ # @overload secondary_value_axis(**kwargs)
383
+ # Configures secondary value axis using keyword arguments.
384
+ # @return [void]
411
385
  # @api public
412
- #: (*(Hash[Symbol, untyped] | String | bool) args, **untyped kwargs) -> untyped
413
- def secondary_value_axis(*args, **kwargs)
414
- if !args.empty?
415
- warn "[Xlsxrb DEPRECATION] ChartBuilder#secondary_value_axis(options) with positional argument is deprecated; use #secondary_value_axis= or #secondary_value_axis(**kwargs) instead.", uplevel: 1
416
- @options[:secondary_value_axis] = args.first
417
- elsif !kwargs.empty?
386
+ #: (**untyped kwargs) -> untyped
387
+ def secondary_value_axis(**kwargs)
388
+ if kwargs.empty?
389
+ @options[:secondary_value_axis]
390
+ else
418
391
  @options[:secondary_value_axis] = kwargs
419
392
  nil
420
- else
421
- @options[:secondary_value_axis]
422
393
  end
423
394
  end
424
395
 
@@ -432,34 +403,13 @@ module Xlsxrb
432
403
  @options[:secondary_value_axis] = value
433
404
  end
434
405
 
435
- # @deprecated Use {#secondary_value_axis} instead.
436
- #: (*(Hash[Symbol, untyped] | String | bool) args, **untyped kwargs) -> untyped
437
- def secondary_axis(*args, **kwargs)
438
- warn "[DEPRECATION] `secondary_axis` is deprecated; use `secondary_value_axis` instead.", uplevel: 1
439
- secondary_value_axis(*args, **kwargs)
440
- end
441
-
442
- # @deprecated Use {#secondary_value_axis=} instead.
443
- #: (untyped value) -> untyped
444
- def secondary_axis=(value)
445
- warn "[DEPRECATION] `secondary_axis=` is deprecated; use `secondary_value_axis=` instead.", uplevel: 1
446
- self.secondary_value_axis = value
447
- end
448
-
449
- # Configures whether to show the legend key in data labels.
406
+ # Returns whether to show the legend key in data labels.
450
407
  #
451
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#show_legend_key=} instead.
452
- # @param value [Boolean, String, nil]
453
- # @return [Boolean, String]
408
+ # @return [Boolean]
454
409
  # @api public
455
- #: (?untyped value) -> untyped
456
- def show_legend_key(value = nil)
457
- if value.nil?
458
- @options[:show_legend_key]
459
- else
460
- warn "[Xlsxrb DEPRECATION] ChartBuilder#show_legend_key(value) is deprecated; use #show_legend_key= instead.", uplevel: 1
461
- @options[:show_legend_key] = value
462
- end
410
+ #: () -> bool
411
+ def show_legend_key?
412
+ @options[:show_legend_key] ? true : false
463
413
  end
464
414
 
465
415
  # Sets whether to show the legend key in data labels.
@@ -467,7 +417,7 @@ module Xlsxrb
467
417
  # @param value [Boolean, nil]
468
418
  # @return [Boolean, nil]
469
419
  # @api public
470
- #: (untyped value) -> untyped
420
+ #: (bool? value) -> bool?
471
421
  def show_legend_key=(value)
472
422
  @options[:show_legend_key] = value
473
423
  end
@@ -485,20 +435,13 @@ module Xlsxrb
485
435
  #: Hash[Symbol, untyped]
486
436
  attr_reader :options
487
437
 
488
- # Configures categories reference for this series (e.g. "Sheet1!$A$2:$A$10").
438
+ # Gets categories reference for this series (e.g. "Sheet1!$A$2:$A$10").
489
439
  #
490
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#categories=} instead.
491
- # @param value [Object, nil]
492
440
  # @return [Object]
493
441
  # @api public
494
- #: (?untyped value) -> untyped
495
- def categories(value = nil)
496
- if value.nil?
497
- @options[:categories]
498
- else
499
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#categories(value) is deprecated; use #categories= instead.", uplevel: 1
500
- @options[:categories] = value
501
- end
442
+ #: () -> untyped
443
+ def categories
444
+ @options[:categories]
502
445
  end
503
446
 
504
447
  # Sets categories reference for this series.
@@ -511,20 +454,13 @@ module Xlsxrb
511
454
  @options[:categories] = value
512
455
  end
513
456
 
514
- # Configures values reference for this series (e.g. "Sheet1!$B$2:$B$10").
457
+ # Gets values reference for this series (e.g. "Sheet1!$B$2:$B$10").
515
458
  #
516
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#values=} instead.
517
- # @param value [Object, nil]
518
459
  # @return [Object]
519
460
  # @api public
520
- #: (?untyped value) -> untyped
521
- def values(value = nil)
522
- if value.nil?
523
- @options[:values]
524
- else
525
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#values(value) is deprecated; use #values= instead.", uplevel: 1
526
- @options[:values] = value
527
- end
461
+ #: () -> untyped
462
+ def values
463
+ @options[:values]
528
464
  end
529
465
 
530
466
  # Sets values reference for this series.
@@ -537,20 +473,13 @@ module Xlsxrb
537
473
  @options[:values] = value
538
474
  end
539
475
 
540
- # Configures the name for this series (e.g. "Total Sales" or cell reference "Sheet1!$B$1").
476
+ # Gets the name for this series (e.g. "Total Sales" or cell reference "Sheet1!$B$1").
541
477
  #
542
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#name=} instead.
543
- # @param value [Object, nil]
544
478
  # @return [Object]
545
479
  # @api public
546
- #: (?untyped value) -> untyped
547
- def name(value = nil)
548
- if value.nil?
549
- @options[:name]
550
- else
551
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#name(value) is deprecated; use #name= instead.", uplevel: 1
552
- @options[:name] = value
553
- end
480
+ #: () -> untyped
481
+ def name
482
+ @options[:name]
554
483
  end
555
484
 
556
485
  # Sets name for this series.
@@ -563,22 +492,22 @@ module Xlsxrb
563
492
  @options[:name] = value
564
493
  end
565
494
 
566
- # Configures data markers for this series.
495
+ # Gets or configures data markers for this series.
567
496
  #
568
- # @param args [Array] Positional arguments.
569
- # @param kwargs [Hash] Keyword arguments.
570
- # @return [Object]
497
+ # @overload marker
498
+ # Returns the configured marker property.
499
+ # @return [Object]
500
+ # @overload marker(**kwargs)
501
+ # Configures marker using keyword arguments.
502
+ # @return [void]
571
503
  # @api public
572
- #: (*untyped args, **untyped kwargs) -> untyped
573
- def marker(*args, **kwargs)
574
- if !args.empty?
575
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#marker(options) with positional argument is deprecated; use #marker= or #marker(**kwargs) instead.", uplevel: 1
576
- @options[:marker] = args.first
577
- elsif !kwargs.empty?
504
+ #: (**untyped kwargs) -> untyped
505
+ def marker(**kwargs)
506
+ if kwargs.empty?
507
+ @options[:marker]
508
+ else
578
509
  @options[:marker] = kwargs
579
510
  nil
580
- else
581
- @options[:marker]
582
511
  end
583
512
  end
584
513
 
@@ -592,22 +521,22 @@ module Xlsxrb
592
521
  @options[:marker] = value
593
522
  end
594
523
 
595
- # Configures fill color/pattern for this series.
524
+ # Gets or configures fill color/pattern for this series.
596
525
  #
597
- # @param args [Array] Positional arguments.
598
- # @param kwargs [Hash] Keyword arguments.
599
- # @return [Object]
526
+ # @overload fill
527
+ # Returns the configured fill property.
528
+ # @return [Object]
529
+ # @overload fill(**kwargs)
530
+ # Configures fill using keyword arguments.
531
+ # @return [void]
600
532
  # @api public
601
- #: (*(Hash[Symbol, String | Numeric | bool | nil] | String) args, **String | Numeric | bool | nil kwargs) -> untyped
602
- def fill(*args, **kwargs)
603
- if !args.empty?
604
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#fill(options) with positional argument is deprecated; use #fill= or #fill(**kwargs) instead.", uplevel: 1
605
- @options[:fill] = args.first
606
- elsif !kwargs.empty?
533
+ #: (**untyped kwargs) -> untyped
534
+ def fill(**kwargs)
535
+ if kwargs.empty?
536
+ @options[:fill]
537
+ else
607
538
  @options[:fill] = kwargs
608
539
  nil
609
- else
610
- @options[:fill]
611
540
  end
612
541
  end
613
542
 
@@ -621,22 +550,22 @@ module Xlsxrb
621
550
  @options[:fill] = value
622
551
  end
623
552
 
624
- # Configures line color/thickness for this series.
553
+ # Gets or configures line color/thickness for this series.
625
554
  #
626
- # @param args [Array] Positional arguments.
627
- # @param kwargs [Hash] Keyword arguments.
628
- # @return [Object]
555
+ # @overload line
556
+ # Returns the configured line property.
557
+ # @return [Object]
558
+ # @overload line(**kwargs)
559
+ # Configures line using keyword arguments.
560
+ # @return [void]
629
561
  # @api public
630
- #: (*(Hash[Symbol, String | Numeric | bool | nil] | String) args, **String | Numeric | bool | nil kwargs) -> untyped
631
- def line(*args, **kwargs)
632
- if !args.empty?
633
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#line(options) with positional argument is deprecated; use #line= or #line(**kwargs) instead.", uplevel: 1
634
- @options[:line] = args.first
635
- elsif !kwargs.empty?
562
+ #: (**untyped kwargs) -> untyped
563
+ def line(**kwargs)
564
+ if kwargs.empty?
565
+ @options[:line]
566
+ else
636
567
  @options[:line] = kwargs
637
568
  nil
638
- else
639
- @options[:line]
640
569
  end
641
570
  end
642
571
 
@@ -650,22 +579,22 @@ module Xlsxrb
650
579
  @options[:line] = value
651
580
  end
652
581
 
653
- # Configures trendline for this series.
582
+ # Gets or configures trendline for this series.
654
583
  #
655
- # @param args [Array] Positional arguments.
656
- # @param kwargs [Hash] Keyword arguments.
657
- # @return [Object]
584
+ # @overload trendline
585
+ # Returns the configured trendline property.
586
+ # @return [Object]
587
+ # @overload trendline(**kwargs)
588
+ # Configures trendline using keyword arguments.
589
+ # @return [void]
658
590
  # @api public
659
- #: (*(Hash[Symbol, String | Numeric | bool | nil] | String) args, **String | Numeric | bool | nil kwargs) -> untyped
660
- def trendline(*args, **kwargs)
661
- if !args.empty?
662
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#trendline(options) with positional argument is deprecated; use #trendline= or #trendline(**kwargs) instead.", uplevel: 1
663
- @options[:trendline] = args.first
664
- elsif !kwargs.empty?
591
+ #: (**untyped kwargs) -> untyped
592
+ def trendline(**kwargs)
593
+ if kwargs.empty?
594
+ @options[:trendline]
595
+ else
665
596
  @options[:trendline] = kwargs
666
597
  nil
667
- else
668
- @options[:trendline]
669
598
  end
670
599
  end
671
600
 
@@ -679,22 +608,22 @@ module Xlsxrb
679
608
  @options[:trendline] = value
680
609
  end
681
610
 
682
- # Configures data labels for this series.
611
+ # Gets or configures data labels for this series.
683
612
  #
684
- # @param args [Array] Positional arguments.
685
- # @param kwargs [Hash] Keyword arguments.
686
- # @return [Object]
613
+ # @overload data_labels
614
+ # Returns the configured data_labels property.
615
+ # @return [Object]
616
+ # @overload data_labels(**kwargs)
617
+ # Configures data_labels using keyword arguments.
618
+ # @return [void]
687
619
  # @api public
688
- #: (*(Hash[Symbol, String | Numeric | bool | nil] | String) args, **String | Numeric | bool | nil kwargs) -> untyped
689
- def data_labels(*args, **kwargs)
690
- if !args.empty?
691
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#data_labels(options) with positional argument is deprecated; use #data_labels= or #data_labels(**kwargs) instead.", uplevel: 1
692
- @options[:data_labels] = args.first
693
- elsif !kwargs.empty?
620
+ #: (**untyped kwargs) -> untyped
621
+ def data_labels(**kwargs)
622
+ if kwargs.empty?
623
+ @options[:data_labels]
624
+ else
694
625
  @options[:data_labels] = kwargs
695
626
  nil
696
- else
697
- @options[:data_labels]
698
627
  end
699
628
  end
700
629
 
@@ -708,20 +637,13 @@ module Xlsxrb
708
637
  @options[:data_labels] = value
709
638
  end
710
639
 
711
- # Configures line smoothing for this series.
640
+ # Returns line smoothing for this series.
712
641
  #
713
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#smooth=} instead.
714
- # @param value [Boolean, nil]
715
- # @return [Boolean, String]
642
+ # @return [Boolean]
716
643
  # @api public
717
- #: (?untyped value) -> untyped
718
- def smooth(value = nil)
719
- if value.nil?
720
- @options[:smooth]
721
- else
722
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#smooth(value) is deprecated; use #smooth= instead.", uplevel: 1
723
- @options[:smooth] = value
724
- end
644
+ #: () -> bool
645
+ def smooth?
646
+ @options[:smooth] ? true : false
725
647
  end
726
648
 
727
649
  # Sets line smoothing for this series.
@@ -729,25 +651,18 @@ module Xlsxrb
729
651
  # @param value [Boolean, nil]
730
652
  # @return [Boolean, nil]
731
653
  # @api public
732
- #: (untyped value) -> untyped
654
+ #: (bool? value) -> bool?
733
655
  def smooth=(value)
734
656
  @options[:smooth] = value
735
657
  end
736
658
 
737
- # Configures 3D bar/column shape (e.g. "cylinder", "cone", "pyramid").
659
+ # Gets 3D bar/column shape (e.g. "cylinder", "cone", "pyramid").
738
660
  #
739
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#shape=} instead.
740
- # @param value [String, nil]
741
- # @return [String]
661
+ # @return [String, nil]
742
662
  # @api public
743
- #: (?untyped value) -> untyped
744
- def shape(value = nil)
745
- if value.nil?
746
- @options[:shape]
747
- else
748
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#shape(value) is deprecated; use #shape= instead.", uplevel: 1
749
- @options[:shape] = value
750
- end
663
+ #: () -> String?
664
+ def shape
665
+ @options[:shape]
751
666
  end
752
667
 
753
668
  # Sets 3D bar/column shape for this series.
@@ -755,25 +670,18 @@ module Xlsxrb
755
670
  # @param value [String, nil]
756
671
  # @return [String, nil]
757
672
  # @api public
758
- #: (untyped value) -> untyped
673
+ #: (String? value) -> String?
759
674
  def shape=(value)
760
675
  @options[:shape] = value
761
676
  end
762
677
 
763
- # Configures individual series chart type override in combo charts.
678
+ # Gets individual series chart type override in combo charts.
764
679
  #
765
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#type=} instead.
766
- # @param value [Symbol, String, nil]
767
- # @return [Symbol, String, Hash, nil]
680
+ # @return [Symbol, String, nil]
768
681
  # @api public
769
- #: (?untyped value) -> untyped
770
- def type(value = nil)
771
- if value.nil?
772
- @options[:type]
773
- else
774
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#type(value) is deprecated; use #type= instead.", uplevel: 1
775
- @options[:type] = value
776
- end
682
+ #: () -> (Symbol | String | nil)
683
+ def type
684
+ @options[:type]
777
685
  end
778
686
 
779
687
  # Sets individual series chart type override.
@@ -781,61 +689,18 @@ module Xlsxrb
781
689
  # @param value [Symbol, String, nil]
782
690
  # @return [Symbol, String, nil]
783
691
  # @api public
784
- #: (untyped value) -> untyped
692
+ #: (Symbol | String | nil value) -> (Symbol | String | nil)
785
693
  def type=(value)
786
694
  @options[:type] = value
787
695
  end
788
696
 
789
- # Configures whether this series uses the secondary value axis.
697
+ # Gets the axis (:primary or :secondary) for this series.
790
698
  #
791
- # @deprecated Use {#axis} with :secondary instead.
792
- # @param args [Array] Positional arguments.
793
- # @param kwargs [Hash] Keyword arguments.
794
- # @return [Boolean, Hash]
795
- # @api public
796
- #: (*bool args, **bool kwargs) -> untyped
797
- def secondary_axis(*args, **kwargs)
798
- warn "[DEPRECATION] `secondary_axis` is deprecated; use `axis(:secondary)` instead.", uplevel: 1
799
- return @options[:secondary_axis] if args.empty? && kwargs.empty?
800
-
801
- val = if kwargs.empty?
802
- args.empty? || args.first
803
- else
804
- kwargs
805
- end
806
- self.axis = val ? :secondary : :primary
807
- end
808
-
809
- # Sets whether this series uses the secondary value axis.
810
- #
811
- # @deprecated Use {#axis=} with :secondary instead.
812
- # @param value [Boolean, nil]
813
- # @return [Boolean, nil]
814
- # @api public
815
- #: (untyped value) -> untyped
816
- def secondary_axis=(value)
817
- warn "[DEPRECATION] `secondary_axis=` is deprecated; use `self.axis = :secondary` instead.", uplevel: 1
818
- self.axis = if value
819
- :secondary
820
- else
821
- :primary
822
- end
823
- end
824
-
825
- # Configures the axis (:primary or :secondary) for this series.
826
- #
827
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#axis=} instead.
828
- # @param value [Symbol, String, nil]
829
699
  # @return [Symbol, String, nil]
830
700
  # @api public
831
- #: (?Symbol | String | nil value) -> (Symbol | String | nil)
832
- def axis(value = nil)
833
- return @options[:axis] if value.nil?
834
-
835
- warn "[Xlsxrb DEPRECATION] SeriesBuilder#axis(value) is deprecated; use #axis= instead.", uplevel: 1
836
- @options[:axis] = value
837
- @options[:secondary_axis] = (value.to_s == "secondary")
838
- value
701
+ #: () -> (Symbol | String | nil)
702
+ def axis
703
+ @options[:axis]
839
704
  end
840
705
 
841
706
  # Sets the axis for this series.