diff options
| author | Randy Morgan <[email protected]> | 2012-07-17 09:41:25 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-07-17 09:41:25 +0900 |
| commit | e67609fc67e00dd35ecefcf1a3ce02a401c2dc09 (patch) | |
| tree | ee3d3dec7527735a68db5c9d8779c5aad4976611 | |
| parent | 40fdb054a0f31a12870d2d12be3928075c738ebf (diff) | |
| download | caxlsx-e67609fc67e00dd35ecefcf1a3ce02a401c2dc09.tar.gz caxlsx-e67609fc67e00dd35ecefcf1a3ce02a401c2dc09.zip | |
move serializable parts list into private method
| -rw-r--r-- | lib/axlsx/workbook/worksheet/worksheet.rb | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb index fd135726..055931cb 100644 --- a/lib/axlsx/workbook/worksheet/worksheet.rb +++ b/lib/axlsx/workbook/worksheet/worksheet.rb @@ -508,21 +508,7 @@ module Axlsx def to_xml_string str = '<?xml version="1.0" encoding="UTF-8"?>' str << worksheet_node - [sheet_pr, dimension, - sheet_view, column_info, - sheet_data, - @sheet_protection, - protected_ranges, - auto_filter, - merged_cells, - print_options, - page_margins, - page_setup, - worksheet_drawing, - worksheet_comments, - tables, - conditional_formattings, - data_validations].each do |item| + serializable_parts.each do |item| item.to_xml_string(str) if item end str << '</worksheet>' @@ -554,6 +540,15 @@ module Axlsx private + def serializable_parts + [sheet_pr, dimension, sheet_view, column_info, + sheet_data, @sheet_protection, protected_ranges, + auto_filter, merged_cells, print_options, + page_margins, page_setup, worksheet_drawing, + worksheet_comments, tables, conditional_formattings, + data_validations] + end + def range(*cell_def) first, last = cell_def cells = [] |
