rubyXL 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rubyXL.rb +1 -0
- data/lib/rubyXL/objects/border.rb +3 -4
- data/lib/rubyXL/objects/calculation_chain.rb +1 -1
- data/lib/rubyXL/objects/cell_style.rb +3 -4
- data/lib/rubyXL/objects/chartsheet.rb +78 -0
- data/lib/rubyXL/objects/container_nodes.rb +2 -3
- data/lib/rubyXL/objects/data_validation.rb +5 -10
- data/lib/rubyXL/objects/document_properties.rb +1 -1
- data/lib/rubyXL/objects/fill.rb +3 -6
- data/lib/rubyXL/objects/filters.rb +120 -0
- data/lib/rubyXL/objects/formula.rb +2 -2
- data/lib/rubyXL/objects/ooxml_object.rb +116 -56
- data/lib/rubyXL/objects/relationships.rb +5 -1
- data/lib/rubyXL/objects/shared_strings.rb +1 -1
- data/lib/rubyXL/objects/sheet_common.rb +50 -0
- data/lib/rubyXL/objects/sheet_data.rb +6 -1
- data/lib/rubyXL/objects/simple_types.rb +78 -0
- data/lib/rubyXL/objects/stylesheet.rb +15 -3
- data/lib/rubyXL/objects/text.rb +4 -5
- data/lib/rubyXL/objects/workbook.rb +151 -26
- data/lib/rubyXL/objects/worksheet.rb +329 -107
- data/lib/rubyXL/parser.rb +12 -11
- data/lib/rubyXL/workbook.rb +3 -2
- data/rdoc/README_rdoc.html +404 -0
- data/rdoc/RubyXL.html +337 -0
- data/rdoc/RubyXL/AExtensionStorageArea.html +105 -0
- data/rdoc/RubyXL/Alignment.html +108 -0
- data/rdoc/RubyXL/AlternateContent.html +105 -0
- data/rdoc/RubyXL/AutoFilter.html +105 -0
- data/rdoc/RubyXL/AutoFilterColumn.html +105 -0
- data/rdoc/RubyXL/BooleanNode.html +105 -0
- data/rdoc/RubyXL/BooleanValue.html +105 -0
- data/rdoc/RubyXL/Border.html +105 -0
- data/rdoc/RubyXL/BorderContainer.html +105 -0
- data/rdoc/RubyXL/BorderEdge.html +156 -0
- data/rdoc/RubyXL/Break.html +105 -0
- data/rdoc/RubyXL/BreakList.html +105 -0
- data/rdoc/RubyXL/CalculationChain.html +159 -0
- data/rdoc/RubyXL/CalculationChainCell.html +108 -0
- data/rdoc/RubyXL/CalculationProperties.html +105 -0
- data/rdoc/RubyXL/Cell.html +428 -0
- data/rdoc/RubyXL/CellSmartTag.html +105 -0
- data/rdoc/RubyXL/CellSmartTagContainer.html +105 -0
- data/rdoc/RubyXL/CellSmartTagProperty.html +105 -0
- data/rdoc/RubyXL/CellStyle.html +108 -0
- data/rdoc/RubyXL/CellStyleContainer.html +105 -0
- data/rdoc/RubyXL/CellStyleXFContainer.html +105 -0
- data/rdoc/RubyXL/CellValue.html +108 -0
- data/rdoc/RubyXL/CellWatch.html +105 -0
- data/rdoc/RubyXL/CellWatchContainer.html +105 -0
- data/rdoc/RubyXL/CellXFContainer.html +105 -0
- data/rdoc/RubyXL/Chartsheet.html +105 -0
- data/rdoc/RubyXL/ChartsheetPageSetup.html +105 -0
- data/rdoc/RubyXL/ChartsheetProperties.html +108 -0
- data/rdoc/RubyXL/ChartsheetProtection.html +108 -0
- data/rdoc/RubyXL/ChartsheetView.html +105 -0
- data/rdoc/RubyXL/ChartsheetViewContainer.html +105 -0
- data/rdoc/RubyXL/Color.html +163 -0
- data/rdoc/RubyXL/ColorFilter.html +105 -0
- data/rdoc/RubyXL/ColorScale.html +105 -0
- data/rdoc/RubyXL/ColorScheme.html +105 -0
- data/rdoc/RubyXL/ColorSet.html +105 -0
- data/rdoc/RubyXL/Colors.html +105 -0
- data/rdoc/RubyXL/ColumnRange.html +233 -0
- data/rdoc/RubyXL/ColumnRanges.html +275 -0
- data/rdoc/RubyXL/ConditionalFormatValue.html +105 -0
- data/rdoc/RubyXL/ConditionalFormatting.html +105 -0
- data/rdoc/RubyXL/ConditionalFormattingRule.html +105 -0
- data/rdoc/RubyXL/CustomFilter.html +105 -0
- data/rdoc/RubyXL/CustomFilterContainer.html +105 -0
- data/rdoc/RubyXL/CustomProperty.html +105 -0
- data/rdoc/RubyXL/CustomPropertyContainer.html +105 -0
- data/rdoc/RubyXL/CustomSheetView.html +105 -0
- data/rdoc/RubyXL/CustomSheetViews.html +105 -0
- data/rdoc/RubyXL/CustomWorkbookView.html +105 -0
- data/rdoc/RubyXL/CustomWorkbookViewContainer.html +105 -0
- data/rdoc/RubyXL/DXF.html +105 -0
- data/rdoc/RubyXL/DXFs.html +105 -0
- data/rdoc/RubyXL/DataBar.html +105 -0
- data/rdoc/RubyXL/DataConsolidate.html +105 -0
- data/rdoc/RubyXL/DataConsolidationReference.html +105 -0
- data/rdoc/RubyXL/DataConsolidationReferences.html +105 -0
- data/rdoc/RubyXL/DataValidation.html +108 -0
- data/rdoc/RubyXL/DataValidations.html +105 -0
- data/rdoc/RubyXL/DateGroupItem.html +108 -0
- data/rdoc/RubyXL/DefinedName.html +105 -0
- data/rdoc/RubyXL/DefinedNames.html +105 -0
- data/rdoc/RubyXL/DocumentProperties.html +271 -0
- data/rdoc/RubyXL/DynamicFilter.html +105 -0
- data/rdoc/RubyXL/EmbeddedControl.html +105 -0
- data/rdoc/RubyXL/EmbeddedControlContainer.html +105 -0
- data/rdoc/RubyXL/Extension.html +228 -0
- data/rdoc/RubyXL/ExtensionStorageArea.html +108 -0
- data/rdoc/RubyXL/ExternalReference.html +105 -0
- data/rdoc/RubyXL/ExternalReferences.html +105 -0
- data/rdoc/RubyXL/FieldItem.html +105 -0
- data/rdoc/RubyXL/FileRecoveryProperties.html +105 -0
- data/rdoc/RubyXL/FileSharing.html +108 -0
- data/rdoc/RubyXL/FileVersion.html +108 -0
- data/rdoc/RubyXL/Fill.html +105 -0
- data/rdoc/RubyXL/FillContainer.html +105 -0
- data/rdoc/RubyXL/FilterContainer.html +105 -0
- data/rdoc/RubyXL/FloatNode.html +105 -0
- data/rdoc/RubyXL/FloatValue.html +105 -0
- data/rdoc/RubyXL/Font.html +655 -0
- data/rdoc/RubyXL/FontContainer.html +105 -0
- data/rdoc/RubyXL/FontScheme.html +105 -0
- data/rdoc/RubyXL/FormatScheme.html +105 -0
- data/rdoc/RubyXL/Formula.html +108 -0
- data/rdoc/RubyXL/FunctionGroup.html +105 -0
- data/rdoc/RubyXL/FunctionGroupContainer.html +105 -0
- data/rdoc/RubyXL/GenericStorage.html +344 -0
- data/rdoc/RubyXL/GradientFill.html +105 -0
- data/rdoc/RubyXL/HeaderFooterSettings.html +105 -0
- data/rdoc/RubyXL/Hyperlink.html +105 -0
- data/rdoc/RubyXL/HyperlinkContainer.html +105 -0
- data/rdoc/RubyXL/IconFilter.html +105 -0
- data/rdoc/RubyXL/IconSet.html +105 -0
- data/rdoc/RubyXL/IgnoredError.html +105 -0
- data/rdoc/RubyXL/IgnoredErrorContainer.html +105 -0
- data/rdoc/RubyXL/IndexedColorContainer.html +105 -0
- data/rdoc/RubyXL/InputCells.html +105 -0
- data/rdoc/RubyXL/IntegerNode.html +105 -0
- data/rdoc/RubyXL/IntegerValue.html +105 -0
- data/rdoc/RubyXL/LegacyCell.html +1498 -0
- data/rdoc/RubyXL/LegacyWorkbook.html +1283 -0
- data/rdoc/RubyXL/LegacyWorksheet.html +3291 -0
- data/rdoc/RubyXL/MRUColorContainer.html +105 -0
- data/rdoc/RubyXL/MergedCell.html +105 -0
- data/rdoc/RubyXL/MergedCells.html +105 -0
- data/rdoc/RubyXL/NumFmt.html +105 -0
- data/rdoc/RubyXL/NumberFormat.html +160 -0
- data/rdoc/RubyXL/NumberFormatContainer.html +173 -0
- data/rdoc/RubyXL/OLEObject.html +105 -0
- data/rdoc/RubyXL/OLEObjects.html +105 -0
- data/rdoc/RubyXL/OLESize.html +105 -0
- data/rdoc/RubyXL/OOXMLObject.html +862 -0
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +105 -0
- data/rdoc/RubyXL/OutlineProperties.html +108 -0
- data/rdoc/RubyXL/PageMargins.html +105 -0
- data/rdoc/RubyXL/PageSetup.html +105 -0
- data/rdoc/RubyXL/PageSetupProperties.html +108 -0
- data/rdoc/RubyXL/Pane.html +105 -0
- data/rdoc/RubyXL/Parser.html +348 -0
- data/rdoc/RubyXL/PatternFill.html +105 -0
- data/rdoc/RubyXL/PhoneticProperties.html +105 -0
- data/rdoc/RubyXL/PhoneticRun.html +105 -0
- data/rdoc/RubyXL/PivotArea.html +105 -0
- data/rdoc/RubyXL/PivotCache.html +105 -0
- data/rdoc/RubyXL/PivotCaches.html +105 -0
- data/rdoc/RubyXL/PivotReference.html +105 -0
- data/rdoc/RubyXL/PivotReferenceContainer.html +105 -0
- data/rdoc/RubyXL/PivotTableSelection.html +105 -0
- data/rdoc/RubyXL/PrintOptions.html +105 -0
- data/rdoc/RubyXL/ProtectedRange.html +105 -0
- data/rdoc/RubyXL/ProtectedRanges.html +105 -0
- data/rdoc/RubyXL/Protection.html +105 -0
- data/rdoc/RubyXL/RID.html +105 -0
- data/rdoc/RubyXL/RawOOXML.html +225 -0
- data/rdoc/RubyXL/Reference.html +642 -0
- data/rdoc/RubyXL/Relationship.html +105 -0
- data/rdoc/RubyXL/RichText.html +105 -0
- data/rdoc/RubyXL/RichTextRun.html +105 -0
- data/rdoc/RubyXL/Row.html +105 -0
- data/rdoc/RubyXL/RunProperties.html +108 -0
- data/rdoc/RubyXL/Scenario.html +105 -0
- data/rdoc/RubyXL/ScenarioContainer.html +105 -0
- data/rdoc/RubyXL/Selection.html +105 -0
- data/rdoc/RubyXL/SharedStringsTable.html +397 -0
- data/rdoc/RubyXL/Sheet.html +105 -0
- data/rdoc/RubyXL/SheetCalculationProperties.html +105 -0
- data/rdoc/RubyXL/SheetData.html +105 -0
- data/rdoc/RubyXL/Sheets.html +105 -0
- data/rdoc/RubyXL/SmartTagContainer.html +105 -0
- data/rdoc/RubyXL/SmartTagProperties.html +105 -0
- data/rdoc/RubyXL/SmartTagType.html +105 -0
- data/rdoc/RubyXL/SmartTagTypeContainer.html +105 -0
- data/rdoc/RubyXL/SortCondition.html +105 -0
- data/rdoc/RubyXL/SortState.html +105 -0
- data/rdoc/RubyXL/Sqref.html +199 -0
- data/rdoc/RubyXL/Stop.html +108 -0
- data/rdoc/RubyXL/StringNode.html +105 -0
- data/rdoc/RubyXL/StringValue.html +105 -0
- data/rdoc/RubyXL/Stylesheet.html +105 -0
- data/rdoc/RubyXL/TableParts.html +105 -0
- data/rdoc/RubyXL/TableStyle.html +105 -0
- data/rdoc/RubyXL/TableStyles.html +105 -0
- data/rdoc/RubyXL/Text.html +195 -0
- data/rdoc/RubyXL/Theme.html +105 -0
- data/rdoc/RubyXL/ThemeElements.html +105 -0
- data/rdoc/RubyXL/Top10.html +105 -0
- data/rdoc/RubyXL/Variant.html +108 -0
- data/rdoc/RubyXL/Vector.html +105 -0
- data/rdoc/RubyXL/VectorValue.html +105 -0
- data/rdoc/RubyXL/WebPublishObject.html +105 -0
- data/rdoc/RubyXL/WebPublishObjectContainer.html +105 -0
- data/rdoc/RubyXL/WebPublishingItem.html +108 -0
- data/rdoc/RubyXL/WebPublishingItemContainer.html +105 -0
- data/rdoc/RubyXL/WebPublishingProperties.html +105 -0
- data/rdoc/RubyXL/Workbook.html +105 -0
- data/rdoc/RubyXL/WorkbookProperties.html +108 -0
- data/rdoc/RubyXL/WorkbookProtection.html +105 -0
- data/rdoc/RubyXL/WorkbookRelationships.html +316 -0
- data/rdoc/RubyXL/WorkbookView.html +105 -0
- data/rdoc/RubyXL/WorkbookViews.html +105 -0
- data/rdoc/RubyXL/Worksheet.html +105 -0
- data/rdoc/RubyXL/WorksheetDimensions.html +105 -0
- data/rdoc/RubyXL/WorksheetFormatProperties.html +105 -0
- data/rdoc/RubyXL/WorksheetProperties.html +108 -0
- data/rdoc/RubyXL/WorksheetProtection.html +105 -0
- data/rdoc/RubyXL/WorksheetView.html +105 -0
- data/rdoc/RubyXL/WorksheetViews.html +105 -0
- data/rdoc/RubyXL/Writer.html +98 -0
- data/rdoc/RubyXL/Writer/ContentTypesWriter.html +289 -0
- data/rdoc/RubyXL/Writer/CoreWriter.html +210 -0
- data/rdoc/RubyXL/Writer/GenericWriter.html +348 -0
- data/rdoc/RubyXL/Writer/RootRelsWriter.html +193 -0
- data/rdoc/RubyXL/Writer/StylesWriter.html +191 -0
- data/rdoc/RubyXL/Writer/ThemeWriter.html +511 -0
- data/rdoc/RubyXL/Writer/WorkbookWriter.html +249 -0
- data/rdoc/RubyXL/Writer/WorksheetWriter.html +236 -0
- data/rdoc/RubyXL/XF.html +105 -0
- data/rdoc/created.rid +24 -21
- data/rdoc/index.html +216 -0
- data/rdoc/js/search_index.js +1 -1
- data/rdoc/table_of_contents.html +1496 -0
- data/rubyXL.gemspec +211 -4
- data/spec/lib/parser_spec.rb +18 -6
- data/test/input/.gitkeep +0 -0
- data/test/output/.gitkeep +0 -0
- data/test/test_parse_write.rb +15 -0
- metadata +211 -4
- data/lib/rubyXL/objects/sheet_view.rb +0 -71
@@ -0,0 +1,1283 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module RubyXL::LegacyWorkbook - rubyXL 2.1.3</title>
|
8
|
+
|
9
|
+
<link href="../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "../";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="../js/jquery.js"></script>
|
17
|
+
<script src="../js/navigation.js"></script>
|
18
|
+
<script src="../js/search_index.js"></script>
|
19
|
+
<script src="../js/search.js"></script>
|
20
|
+
<script src="../js/searcher.js"></script>
|
21
|
+
<script src="../js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="includes-section" class="nav-section">
|
62
|
+
<h3>Included Modules</h3>
|
63
|
+
|
64
|
+
<ul class="link-list">
|
65
|
+
|
66
|
+
|
67
|
+
<li><span class="include">Enumerable</span>
|
68
|
+
|
69
|
+
|
70
|
+
</ul>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
|
74
|
+
<!-- Method Quickref -->
|
75
|
+
<div id="method-list-section" class="nav-section">
|
76
|
+
<h3>Methods</h3>
|
77
|
+
|
78
|
+
<ul class="link-list" role="directory">
|
79
|
+
|
80
|
+
<li class="calls-super" ><a href="#method-c-new">::new</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-5B-5D">#[]</a>
|
83
|
+
|
84
|
+
<li ><a href="#method-i-add_worksheet">#add_worksheet</a>
|
85
|
+
|
86
|
+
<li ><a href="#method-i-borders">#borders</a>
|
87
|
+
|
88
|
+
<li ><a href="#method-i-cell_xfs">#cell_xfs</a>
|
89
|
+
|
90
|
+
<li ><a href="#method-i-date_to_num">#date_to_num</a>
|
91
|
+
|
92
|
+
<li ><a href="#method-i-each">#each</a>
|
93
|
+
|
94
|
+
<li ><a href="#method-i-fills">#fills</a>
|
95
|
+
|
96
|
+
<li ><a href="#method-i-fonts">#fonts</a>
|
97
|
+
|
98
|
+
<li ><a href="#method-i-get_fill_color">#get_fill_color</a>
|
99
|
+
|
100
|
+
<li ><a href="#method-i-modify_alignment">#modify_alignment</a>
|
101
|
+
|
102
|
+
<li ><a href="#method-i-modify_border">#modify_border</a>
|
103
|
+
|
104
|
+
<li ><a href="#method-i-modify_fill">#modify_fill</a>
|
105
|
+
|
106
|
+
<li ><a href="#method-i-modify_text_wrap">#modify_text_wrap</a>
|
107
|
+
|
108
|
+
<li ><a href="#method-i-num_to_date">#num_to_date</a>
|
109
|
+
|
110
|
+
<li ><a href="#method-i-register_new_fill">#register_new_fill</a>
|
111
|
+
|
112
|
+
<li ><a href="#method-i-register_new_font">#register_new_font</a>
|
113
|
+
|
114
|
+
<li ><a href="#method-i-register_new_xf">#register_new_xf</a>
|
115
|
+
|
116
|
+
<li ><a href="#method-i-write">#write</a>
|
117
|
+
|
118
|
+
</ul>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
</div>
|
122
|
+
</nav>
|
123
|
+
|
124
|
+
<main role="main" aria-labelledby="module-RubyXL::LegacyWorkbook">
|
125
|
+
<h1 id="module-RubyXL::LegacyWorkbook" class="module">
|
126
|
+
module RubyXL::LegacyWorkbook
|
127
|
+
</h1>
|
128
|
+
|
129
|
+
<section class="description">
|
130
|
+
|
131
|
+
</section>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<section class="constants-list">
|
143
|
+
<header>
|
144
|
+
<h3>Constants</h3>
|
145
|
+
</header>
|
146
|
+
<dl>
|
147
|
+
|
148
|
+
<dt id="APPLICATION">APPLICATION
|
149
|
+
|
150
|
+
<dd>
|
151
|
+
|
152
|
+
|
153
|
+
<dt id="APPVERSION">APPVERSION
|
154
|
+
|
155
|
+
<dd>
|
156
|
+
|
157
|
+
|
158
|
+
<dt id="SHEET_NAME_TEMPLATE">SHEET_NAME_TEMPLATE
|
159
|
+
|
160
|
+
<dd>
|
161
|
+
|
162
|
+
|
163
|
+
</dl>
|
164
|
+
</section>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<section class="attribute-method-details" class="method-section">
|
169
|
+
<header>
|
170
|
+
<h3>Attributes</h3>
|
171
|
+
</header>
|
172
|
+
|
173
|
+
|
174
|
+
<div id="attribute-i-calculation_chain" class="method-detail">
|
175
|
+
<div class="method-heading attribute-method-heading">
|
176
|
+
<span class="method-name">calculation_chain</span><span
|
177
|
+
class="attribute-access-type">[RW]</span>
|
178
|
+
</div>
|
179
|
+
|
180
|
+
<div class="method-description">
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<div id="attribute-i-chart_rels" class="method-detail">
|
188
|
+
<div class="method-heading attribute-method-heading">
|
189
|
+
<span class="method-name">chart_rels</span><span
|
190
|
+
class="attribute-access-type">[RW]</span>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div id="attribute-i-charts" class="method-detail">
|
201
|
+
<div class="method-heading attribute-method-heading">
|
202
|
+
<span class="method-name">charts</span><span
|
203
|
+
class="attribute-access-type">[RW]</span>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div class="method-description">
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</div>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
<div id="attribute-i-chartsheet_rels" class="method-detail">
|
214
|
+
<div class="method-heading attribute-method-heading">
|
215
|
+
<span class="method-name">chartsheet_rels</span><span
|
216
|
+
class="attribute-access-type">[RW]</span>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
<div class="method-description">
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
</div>
|
224
|
+
</div>
|
225
|
+
|
226
|
+
<div id="attribute-i-created_at" class="method-detail">
|
227
|
+
<div class="method-heading attribute-method-heading">
|
228
|
+
<span class="method-name">created_at</span><span
|
229
|
+
class="attribute-access-type">[RW]</span>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
<div class="method-description">
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<div id="attribute-i-creator" class="method-detail">
|
240
|
+
<div class="method-heading attribute-method-heading">
|
241
|
+
<span class="method-name">creator</span><span
|
242
|
+
class="attribute-access-type">[RW]</span>
|
243
|
+
</div>
|
244
|
+
|
245
|
+
<div class="method-description">
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
</div>
|
250
|
+
</div>
|
251
|
+
|
252
|
+
<div id="attribute-i-document_properties" class="method-detail">
|
253
|
+
<div class="method-heading attribute-method-heading">
|
254
|
+
<span class="method-name">document_properties</span><span
|
255
|
+
class="attribute-access-type">[RW]</span>
|
256
|
+
</div>
|
257
|
+
|
258
|
+
<div class="method-description">
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
</div>
|
263
|
+
</div>
|
264
|
+
|
265
|
+
<div id="attribute-i-drawings" class="method-detail">
|
266
|
+
<div class="method-heading attribute-method-heading">
|
267
|
+
<span class="method-name">drawings</span><span
|
268
|
+
class="attribute-access-type">[RW]</span>
|
269
|
+
</div>
|
270
|
+
|
271
|
+
<div class="method-description">
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
</div>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
<div id="attribute-i-drawings_rels" class="method-detail">
|
279
|
+
<div class="method-heading attribute-method-heading">
|
280
|
+
<span class="method-name">drawings_rels</span><span
|
281
|
+
class="attribute-access-type">[RW]</span>
|
282
|
+
</div>
|
283
|
+
|
284
|
+
<div class="method-description">
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
</div>
|
289
|
+
</div>
|
290
|
+
|
291
|
+
<div id="attribute-i-external_links" class="method-detail">
|
292
|
+
<div class="method-heading attribute-method-heading">
|
293
|
+
<span class="method-name">external_links</span><span
|
294
|
+
class="attribute-access-type">[RW]</span>
|
295
|
+
</div>
|
296
|
+
|
297
|
+
<div class="method-description">
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
</div>
|
302
|
+
</div>
|
303
|
+
|
304
|
+
<div id="attribute-i-external_links_rels" class="method-detail">
|
305
|
+
<div class="method-heading attribute-method-heading">
|
306
|
+
<span class="method-name">external_links_rels</span><span
|
307
|
+
class="attribute-access-type">[RW]</span>
|
308
|
+
</div>
|
309
|
+
|
310
|
+
<div class="method-description">
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
</div>
|
315
|
+
</div>
|
316
|
+
|
317
|
+
<div id="attribute-i-filepath" class="method-detail">
|
318
|
+
<div class="method-heading attribute-method-heading">
|
319
|
+
<span class="method-name">filepath</span><span
|
320
|
+
class="attribute-access-type">[RW]</span>
|
321
|
+
</div>
|
322
|
+
|
323
|
+
<div class="method-description">
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
</div>
|
328
|
+
</div>
|
329
|
+
|
330
|
+
<div id="attribute-i-macros" class="method-detail">
|
331
|
+
<div class="method-heading attribute-method-heading">
|
332
|
+
<span class="method-name">macros</span><span
|
333
|
+
class="attribute-access-type">[RW]</span>
|
334
|
+
</div>
|
335
|
+
|
336
|
+
<div class="method-description">
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
</div>
|
341
|
+
</div>
|
342
|
+
|
343
|
+
<div id="attribute-i-media" class="method-detail">
|
344
|
+
<div class="method-heading attribute-method-heading">
|
345
|
+
<span class="method-name">media</span><span
|
346
|
+
class="attribute-access-type">[RW]</span>
|
347
|
+
</div>
|
348
|
+
|
349
|
+
<div class="method-description">
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
</div>
|
354
|
+
</div>
|
355
|
+
|
356
|
+
<div id="attribute-i-modified_at" class="method-detail">
|
357
|
+
<div class="method-heading attribute-method-heading">
|
358
|
+
<span class="method-name">modified_at</span><span
|
359
|
+
class="attribute-access-type">[RW]</span>
|
360
|
+
</div>
|
361
|
+
|
362
|
+
<div class="method-description">
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
</div>
|
367
|
+
</div>
|
368
|
+
|
369
|
+
<div id="attribute-i-modifier" class="method-detail">
|
370
|
+
<div class="method-heading attribute-method-heading">
|
371
|
+
<span class="method-name">modifier</span><span
|
372
|
+
class="attribute-access-type">[RW]</span>
|
373
|
+
</div>
|
374
|
+
|
375
|
+
<div class="method-description">
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
</div>
|
380
|
+
</div>
|
381
|
+
|
382
|
+
<div id="attribute-i-printer_settings" class="method-detail">
|
383
|
+
<div class="method-heading attribute-method-heading">
|
384
|
+
<span class="method-name">printer_settings</span><span
|
385
|
+
class="attribute-access-type">[RW]</span>
|
386
|
+
</div>
|
387
|
+
|
388
|
+
<div class="method-description">
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
</div>
|
393
|
+
</div>
|
394
|
+
|
395
|
+
<div id="attribute-i-relationship_container" class="method-detail">
|
396
|
+
<div class="method-heading attribute-method-heading">
|
397
|
+
<span class="method-name">relationship_container</span><span
|
398
|
+
class="attribute-access-type">[RW]</span>
|
399
|
+
</div>
|
400
|
+
|
401
|
+
<div class="method-description">
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
</div>
|
406
|
+
</div>
|
407
|
+
|
408
|
+
<div id="attribute-i-shared_strings_container" class="method-detail">
|
409
|
+
<div class="method-heading attribute-method-heading">
|
410
|
+
<span class="method-name">shared_strings_container</span><span
|
411
|
+
class="attribute-access-type">[RW]</span>
|
412
|
+
</div>
|
413
|
+
|
414
|
+
<div class="method-description">
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
</div>
|
419
|
+
</div>
|
420
|
+
|
421
|
+
<div id="attribute-i-stylesheet" class="method-detail">
|
422
|
+
<div class="method-heading attribute-method-heading">
|
423
|
+
<span class="method-name">stylesheet</span><span
|
424
|
+
class="attribute-access-type">[RW]</span>
|
425
|
+
</div>
|
426
|
+
|
427
|
+
<div class="method-description">
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
</div>
|
432
|
+
</div>
|
433
|
+
|
434
|
+
<div id="attribute-i-theme" class="method-detail">
|
435
|
+
<div class="method-heading attribute-method-heading">
|
436
|
+
<span class="method-name">theme</span><span
|
437
|
+
class="attribute-access-type">[RW]</span>
|
438
|
+
</div>
|
439
|
+
|
440
|
+
<div class="method-description">
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
</div>
|
445
|
+
</div>
|
446
|
+
|
447
|
+
<div id="attribute-i-worksheet_rels" class="method-detail">
|
448
|
+
<div class="method-heading attribute-method-heading">
|
449
|
+
<span class="method-name">worksheet_rels</span><span
|
450
|
+
class="attribute-access-type">[RW]</span>
|
451
|
+
</div>
|
452
|
+
|
453
|
+
<div class="method-description">
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
</div>
|
458
|
+
</div>
|
459
|
+
|
460
|
+
<div id="attribute-i-worksheets" class="method-detail">
|
461
|
+
<div class="method-heading attribute-method-heading">
|
462
|
+
<span class="method-name">worksheets</span><span
|
463
|
+
class="attribute-access-type">[RW]</span>
|
464
|
+
</div>
|
465
|
+
|
466
|
+
<div class="method-description">
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
</div>
|
471
|
+
</div>
|
472
|
+
|
473
|
+
</section>
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
478
|
+
<header>
|
479
|
+
<h3>Public Class Methods</h3>
|
480
|
+
</header>
|
481
|
+
|
482
|
+
|
483
|
+
<div id="method-c-new" class="method-detail ">
|
484
|
+
|
485
|
+
<div class="method-heading">
|
486
|
+
<span class="method-name">new</span><span
|
487
|
+
class="method-args">(worksheets=[], filepath=nil, creator=nil, modifier=nil, created_at=nil, company='', application=APPLICATION, appversion=APPVERSION, date1904=0)</span>
|
488
|
+
|
489
|
+
<span class="method-click-advice">click to toggle source</span>
|
490
|
+
|
491
|
+
</div>
|
492
|
+
|
493
|
+
|
494
|
+
<div class="method-description">
|
495
|
+
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
<div class="method-calls-super">
|
500
|
+
Calls superclass method
|
501
|
+
|
502
|
+
</div>
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
<div class="method-source-code" id="new-source">
|
507
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 26</span>
|
508
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">worksheets</span>=[], <span class="ruby-identifier">filepath</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">creator</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">modifier</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">created_at</span>=<span class="ruby-keyword">nil</span>,
|
509
|
+
<span class="ruby-identifier">company</span>=<span class="ruby-string">''</span>, <span class="ruby-identifier">application</span>=<span class="ruby-constant">APPLICATION</span>,
|
510
|
+
<span class="ruby-identifier">appversion</span>=<span class="ruby-constant">APPVERSION</span>, <span class="ruby-identifier">date1904</span>=<span class="ruby-value">0</span>)
|
511
|
+
<span class="ruby-keyword">super</span>()
|
512
|
+
|
513
|
+
<span class="ruby-comment"># Order of sheets in the +worksheets+ array corresponds to the order of pages in Excel UI.</span>
|
514
|
+
<span class="ruby-comment"># SheetId's, rId's, etc. are completely unrelated to ordering.</span>
|
515
|
+
<span class="ruby-ivar">@worksheets</span> = <span class="ruby-identifier">worksheets</span>
|
516
|
+
<span class="ruby-identifier">add_worksheet</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@worksheets</span>.<span class="ruby-identifier">empty?</span>
|
517
|
+
|
518
|
+
<span class="ruby-ivar">@filepath</span> = <span class="ruby-identifier">filepath</span>
|
519
|
+
<span class="ruby-ivar">@creator</span> = <span class="ruby-identifier">creator</span>
|
520
|
+
<span class="ruby-ivar">@modifier</span> = <span class="ruby-identifier">modifier</span>
|
521
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">date1904</span> = <span class="ruby-identifier">date1904</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
522
|
+
<span class="ruby-ivar">@media</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'media'</span>)).<span class="ruby-identifier">binary</span>
|
523
|
+
<span class="ruby-ivar">@external_links</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'externalLinks'</span>))
|
524
|
+
<span class="ruby-ivar">@external_links_rels</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'externalLinks'</span>, <span class="ruby-string">'_rels'</span>))
|
525
|
+
<span class="ruby-ivar">@drawings</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'drawings'</span>))
|
526
|
+
<span class="ruby-ivar">@drawings_rels</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'drawings'</span>, <span class="ruby-string">'_rels'</span>))
|
527
|
+
<span class="ruby-ivar">@charts</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'charts'</span>))
|
528
|
+
<span class="ruby-ivar">@chart_rels</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'charts'</span>, <span class="ruby-string">'_rels'</span>))
|
529
|
+
<span class="ruby-ivar">@worksheet_rels</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'worksheets'</span>, <span class="ruby-string">'_rels'</span>))
|
530
|
+
<span class="ruby-ivar">@chartsheet_rels</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'chartsheets'</span>, <span class="ruby-string">'_rels'</span>))
|
531
|
+
<span class="ruby-ivar">@theme</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'theme'</span>))
|
532
|
+
<span class="ruby-ivar">@printer_settings</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">'xl'</span>, <span class="ruby-string">'printerSettings'</span>)).<span class="ruby-identifier">binary</span>
|
533
|
+
<span class="ruby-ivar">@macros</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericStorage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">'xl'</span>).<span class="ruby-identifier">binary</span>
|
534
|
+
|
535
|
+
<span class="ruby-ivar">@shared_strings_container</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedStringsTable</span>.<span class="ruby-identifier">new</span>
|
536
|
+
<span class="ruby-ivar">@stylesheet</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Stylesheet</span>.<span class="ruby-identifier">default</span>
|
537
|
+
<span class="ruby-ivar">@document_properties</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">DocumentProperties</span>.<span class="ruby-identifier">new</span>
|
538
|
+
<span class="ruby-ivar">@relationship_container</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">WorkbookRelationships</span>.<span class="ruby-identifier">new</span>
|
539
|
+
<span class="ruby-ivar">@calculation_chain</span> = <span class="ruby-keyword">nil</span>
|
540
|
+
|
541
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">company</span> = <span class="ruby-identifier">company</span>
|
542
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">application</span> = <span class="ruby-identifier">application</span>
|
543
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">appversion</span> = <span class="ruby-identifier">appversion</span>
|
544
|
+
|
545
|
+
<span class="ruby-keyword">begin</span>
|
546
|
+
<span class="ruby-ivar">@created_at</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">created_at</span>).<span class="ruby-identifier">strftime</span>(<span class="ruby-string">'%Y-%m-%dT%TZ'</span>)
|
547
|
+
<span class="ruby-keyword">rescue</span>
|
548
|
+
<span class="ruby-ivar">@created_at</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-string">'%Y-%m-%dT%TZ'</span>)
|
549
|
+
<span class="ruby-keyword">end</span>
|
550
|
+
<span class="ruby-ivar">@modified_at</span> = <span class="ruby-ivar">@created_at</span>
|
551
|
+
<span class="ruby-keyword">end</span></pre>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
</div>
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
</div>
|
560
|
+
|
561
|
+
|
562
|
+
</section>
|
563
|
+
|
564
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
565
|
+
<header>
|
566
|
+
<h3>Public Instance Methods</h3>
|
567
|
+
</header>
|
568
|
+
|
569
|
+
|
570
|
+
<div id="method-i-5B-5D" class="method-detail ">
|
571
|
+
|
572
|
+
<div class="method-heading">
|
573
|
+
<span class="method-name">[]</span><span
|
574
|
+
class="method-args">(ind)</span>
|
575
|
+
|
576
|
+
<span class="method-click-advice">click to toggle source</span>
|
577
|
+
|
578
|
+
</div>
|
579
|
+
|
580
|
+
|
581
|
+
<div class="method-description">
|
582
|
+
|
583
|
+
<p>Finds worksheet by its name or numerical index</p>
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
|
588
|
+
<div class="method-source-code" id="5B-5D-source">
|
589
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 72</span>
|
590
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">ind</span>)
|
591
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">ind</span>
|
592
|
+
<span class="ruby-keyword">when</span> <span class="ruby-constant">Integer</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">worksheets</span>[<span class="ruby-identifier">ind</span>]
|
593
|
+
<span class="ruby-keyword">when</span> <span class="ruby-constant">String</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">worksheets</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ws</span><span class="ruby-operator">|</span> <span class="ruby-identifier">ws</span>.<span class="ruby-identifier">sheet_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">ind</span> }
|
594
|
+
<span class="ruby-keyword">end</span>
|
595
|
+
<span class="ruby-keyword">end</span></pre>
|
596
|
+
</div>
|
597
|
+
|
598
|
+
</div>
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
</div>
|
604
|
+
|
605
|
+
|
606
|
+
<div id="method-i-add_worksheet" class="method-detail ">
|
607
|
+
|
608
|
+
<div class="method-heading">
|
609
|
+
<span class="method-name">add_worksheet</span><span
|
610
|
+
class="method-args">(name = nil)</span>
|
611
|
+
|
612
|
+
<span class="method-click-advice">click to toggle source</span>
|
613
|
+
|
614
|
+
</div>
|
615
|
+
|
616
|
+
|
617
|
+
<div class="method-description">
|
618
|
+
|
619
|
+
<p>Create new simple worksheet and add it to the workbook worksheets</p>
|
620
|
+
|
621
|
+
<p>@param [String] The name for the new worksheet</p>
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
|
626
|
+
<div class="method-source-code" id="add_worksheet-source">
|
627
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 82</span>
|
628
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_worksheet</span>(<span class="ruby-identifier">name</span> = <span class="ruby-keyword">nil</span>)
|
629
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">then</span>
|
630
|
+
<span class="ruby-identifier">n</span> = <span class="ruby-value">0</span>
|
631
|
+
|
632
|
+
<span class="ruby-keyword">begin</span>
|
633
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-constant">SHEET_NAME_TEMPLATE</span> <span class="ruby-operator">%</span> (<span class="ruby-identifier">n</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>)
|
634
|
+
<span class="ruby-keyword">end</span> <span class="ruby-keyword">until</span> <span class="ruby-keyword">self</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">nil?</span>
|
635
|
+
<span class="ruby-keyword">end</span>
|
636
|
+
|
637
|
+
<span class="ruby-identifier">new_worksheet</span> = <span class="ruby-constant">Worksheet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:workbook</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">self</span>, <span class="ruby-value">:sheet_name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">name</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">get_default_name</span>)
|
638
|
+
<span class="ruby-identifier">worksheets</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">new_worksheet</span>
|
639
|
+
<span class="ruby-identifier">new_worksheet</span>
|
640
|
+
<span class="ruby-keyword">end</span></pre>
|
641
|
+
</div>
|
642
|
+
|
643
|
+
</div>
|
644
|
+
|
645
|
+
|
646
|
+
|
647
|
+
|
648
|
+
</div>
|
649
|
+
|
650
|
+
|
651
|
+
<div id="method-i-borders" class="method-detail ">
|
652
|
+
|
653
|
+
<div class="method-heading">
|
654
|
+
<span class="method-name">borders</span><span
|
655
|
+
class="method-args">()</span>
|
656
|
+
|
657
|
+
<span class="method-click-advice">click to toggle source</span>
|
658
|
+
|
659
|
+
</div>
|
660
|
+
|
661
|
+
|
662
|
+
<div class="method-description">
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
|
668
|
+
|
669
|
+
<div class="method-source-code" id="borders-source">
|
670
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 260</span>
|
671
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">borders</span> <span class="ruby-comment"># Stylesheet should be pre-filled with defaults on initialize()</span>
|
672
|
+
<span class="ruby-identifier">stylesheet</span>.<span class="ruby-identifier">border_container</span>.<span class="ruby-identifier">borders</span>
|
673
|
+
<span class="ruby-keyword">end</span></pre>
|
674
|
+
</div>
|
675
|
+
|
676
|
+
</div>
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
</div>
|
682
|
+
|
683
|
+
|
684
|
+
<div id="method-i-cell_xfs" class="method-detail ">
|
685
|
+
|
686
|
+
<div class="method-heading">
|
687
|
+
<span class="method-name">cell_xfs</span><span
|
688
|
+
class="method-args">()</span>
|
689
|
+
|
690
|
+
<span class="method-click-advice">click to toggle source</span>
|
691
|
+
|
692
|
+
</div>
|
693
|
+
|
694
|
+
|
695
|
+
<div class="method-description">
|
696
|
+
|
697
|
+
|
698
|
+
|
699
|
+
|
700
|
+
|
701
|
+
|
702
|
+
<div class="method-source-code" id="cell_xfs-source">
|
703
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 248</span>
|
704
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">cell_xfs</span> <span class="ruby-comment"># Stylesheet should be pre-filled with defaults on initialize()</span>
|
705
|
+
<span class="ruby-identifier">stylesheet</span>.<span class="ruby-identifier">cell_xf_container</span>.<span class="ruby-identifier">xfs</span>
|
706
|
+
<span class="ruby-keyword">end</span></pre>
|
707
|
+
</div>
|
708
|
+
|
709
|
+
</div>
|
710
|
+
|
711
|
+
|
712
|
+
|
713
|
+
|
714
|
+
</div>
|
715
|
+
|
716
|
+
|
717
|
+
<div id="method-i-date_to_num" class="method-detail ">
|
718
|
+
|
719
|
+
<div class="method-heading">
|
720
|
+
<span class="method-name">date_to_num</span><span
|
721
|
+
class="method-args">(date)</span>
|
722
|
+
|
723
|
+
<span class="method-click-advice">click to toggle source</span>
|
724
|
+
|
725
|
+
</div>
|
726
|
+
|
727
|
+
|
728
|
+
<div class="method-description">
|
729
|
+
|
730
|
+
|
731
|
+
|
732
|
+
|
733
|
+
|
734
|
+
|
735
|
+
<div class="method-source-code" id="date_to_num-source">
|
736
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 146</span>
|
737
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">date_to_num</span>(<span class="ruby-identifier">date</span>)
|
738
|
+
<span class="ruby-identifier">date</span> <span class="ruby-operator">&&</span> (<span class="ruby-identifier">date</span>.<span class="ruby-identifier">ajd</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">base_date</span>().<span class="ruby-identifier">ajd</span>).<span class="ruby-identifier">to_i</span>
|
739
|
+
<span class="ruby-keyword">end</span></pre>
|
740
|
+
</div>
|
741
|
+
|
742
|
+
</div>
|
743
|
+
|
744
|
+
|
745
|
+
|
746
|
+
|
747
|
+
</div>
|
748
|
+
|
749
|
+
|
750
|
+
<div id="method-i-each" class="method-detail ">
|
751
|
+
|
752
|
+
<div class="method-heading">
|
753
|
+
<span class="method-name">each</span><span
|
754
|
+
class="method-args">() { |i| ... }</span>
|
755
|
+
|
756
|
+
<span class="method-click-advice">click to toggle source</span>
|
757
|
+
|
758
|
+
</div>
|
759
|
+
|
760
|
+
|
761
|
+
<div class="method-description">
|
762
|
+
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
|
767
|
+
|
768
|
+
<div class="method-source-code" id="each-source">
|
769
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 96</span>
|
770
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>
|
771
|
+
<span class="ruby-identifier">worksheets</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">i</span>}
|
772
|
+
<span class="ruby-keyword">end</span></pre>
|
773
|
+
</div>
|
774
|
+
|
775
|
+
</div>
|
776
|
+
|
777
|
+
|
778
|
+
|
779
|
+
|
780
|
+
</div>
|
781
|
+
|
782
|
+
|
783
|
+
<div id="method-i-fills" class="method-detail ">
|
784
|
+
|
785
|
+
<div class="method-heading">
|
786
|
+
<span class="method-name">fills</span><span
|
787
|
+
class="method-args">()</span>
|
788
|
+
|
789
|
+
<span class="method-click-advice">click to toggle source</span>
|
790
|
+
|
791
|
+
</div>
|
792
|
+
|
793
|
+
|
794
|
+
<div class="method-description">
|
795
|
+
|
796
|
+
|
797
|
+
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
<div class="method-source-code" id="fills-source">
|
802
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 256</span>
|
803
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">fills</span> <span class="ruby-comment"># Stylesheet should be pre-filled with defaults on initialize()</span>
|
804
|
+
<span class="ruby-identifier">stylesheet</span>.<span class="ruby-identifier">fill_container</span>.<span class="ruby-identifier">fills</span>
|
805
|
+
<span class="ruby-keyword">end</span></pre>
|
806
|
+
</div>
|
807
|
+
|
808
|
+
</div>
|
809
|
+
|
810
|
+
|
811
|
+
|
812
|
+
|
813
|
+
</div>
|
814
|
+
|
815
|
+
|
816
|
+
<div id="method-i-fonts" class="method-detail ">
|
817
|
+
|
818
|
+
<div class="method-heading">
|
819
|
+
<span class="method-name">fonts</span><span
|
820
|
+
class="method-args">()</span>
|
821
|
+
|
822
|
+
<span class="method-click-advice">click to toggle source</span>
|
823
|
+
|
824
|
+
</div>
|
825
|
+
|
826
|
+
|
827
|
+
<div class="method-description">
|
828
|
+
|
829
|
+
|
830
|
+
|
831
|
+
|
832
|
+
|
833
|
+
|
834
|
+
<div class="method-source-code" id="fonts-source">
|
835
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 252</span>
|
836
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">fonts</span> <span class="ruby-comment"># Stylesheet should be pre-filled with defaults on initialize()</span>
|
837
|
+
<span class="ruby-identifier">stylesheet</span>.<span class="ruby-identifier">font_container</span>.<span class="ruby-identifier">fonts</span>
|
838
|
+
<span class="ruby-keyword">end</span></pre>
|
839
|
+
</div>
|
840
|
+
|
841
|
+
</div>
|
842
|
+
|
843
|
+
|
844
|
+
|
845
|
+
|
846
|
+
</div>
|
847
|
+
|
848
|
+
|
849
|
+
<div id="method-i-get_fill_color" class="method-detail ">
|
850
|
+
|
851
|
+
<div class="method-heading">
|
852
|
+
<span class="method-name">get_fill_color</span><span
|
853
|
+
class="method-args">(xf)</span>
|
854
|
+
|
855
|
+
<span class="method-click-advice">click to toggle source</span>
|
856
|
+
|
857
|
+
</div>
|
858
|
+
|
859
|
+
|
860
|
+
<div class="method-description">
|
861
|
+
|
862
|
+
|
863
|
+
|
864
|
+
|
865
|
+
|
866
|
+
|
867
|
+
<div class="method-source-code" id="get_fill_color-source">
|
868
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 154</span>
|
869
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_fill_color</span>(<span class="ruby-identifier">xf</span>)
|
870
|
+
<span class="ruby-identifier">fill</span> = <span class="ruby-identifier">fills</span>[<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">fill_id</span>]
|
871
|
+
<span class="ruby-identifier">pattern</span> = <span class="ruby-identifier">fill</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">fill</span>.<span class="ruby-identifier">pattern_fill</span>
|
872
|
+
<span class="ruby-identifier">color</span> = <span class="ruby-identifier">pattern</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">fg_color</span>
|
873
|
+
<span class="ruby-identifier">color</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">color</span>.<span class="ruby-identifier">rgb</span> <span class="ruby-operator">||</span> <span class="ruby-string">'ffffff'</span>
|
874
|
+
<span class="ruby-keyword">end</span></pre>
|
875
|
+
</div>
|
876
|
+
|
877
|
+
</div>
|
878
|
+
|
879
|
+
|
880
|
+
|
881
|
+
|
882
|
+
</div>
|
883
|
+
|
884
|
+
|
885
|
+
<div id="method-i-modify_alignment" class="method-detail ">
|
886
|
+
|
887
|
+
<div class="method-heading">
|
888
|
+
<span class="method-name">modify_alignment</span><span
|
889
|
+
class="method-args">(style_index, is_horizontal, alignment)</span>
|
890
|
+
|
891
|
+
<span class="method-click-advice">click to toggle source</span>
|
892
|
+
|
893
|
+
</div>
|
894
|
+
|
895
|
+
|
896
|
+
<div class="method-description">
|
897
|
+
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
|
902
|
+
|
903
|
+
<div class="method-source-code" id="modify_alignment-source">
|
904
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 210</span>
|
905
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">modify_alignment</span>(<span class="ruby-identifier">style_index</span>, <span class="ruby-identifier">is_horizontal</span>, <span class="ruby-identifier">alignment</span>)
|
906
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">cell_xfs</span>[<span class="ruby-identifier">style_index</span>].<span class="ruby-identifier">dup</span>
|
907
|
+
<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">alignment</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Alignment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:apply_alignment</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">true</span>,
|
908
|
+
<span class="ruby-value">:horizontal</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">is_horizontal</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">alignment</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>,
|
909
|
+
<span class="ruby-value">:vertical</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">is_horizontal</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">alignment</span>)
|
910
|
+
<span class="ruby-identifier">register_new_xf</span>(<span class="ruby-identifier">xf</span>, <span class="ruby-identifier">style_index</span>)
|
911
|
+
<span class="ruby-keyword">end</span></pre>
|
912
|
+
</div>
|
913
|
+
|
914
|
+
</div>
|
915
|
+
|
916
|
+
|
917
|
+
|
918
|
+
|
919
|
+
</div>
|
920
|
+
|
921
|
+
|
922
|
+
<div id="method-i-modify_border" class="method-detail ">
|
923
|
+
|
924
|
+
<div class="method-heading">
|
925
|
+
<span class="method-name">modify_border</span><span
|
926
|
+
class="method-args">(style_index, direction, weight)</span>
|
927
|
+
|
928
|
+
<span class="method-click-advice">click to toggle source</span>
|
929
|
+
|
930
|
+
</div>
|
931
|
+
|
932
|
+
|
933
|
+
<div class="method-description">
|
934
|
+
|
935
|
+
|
936
|
+
|
937
|
+
|
938
|
+
|
939
|
+
|
940
|
+
<div class="method-source-code" id="modify_border-source">
|
941
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 227</span>
|
942
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">modify_border</span>(<span class="ruby-identifier">style_index</span>, <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">weight</span>)
|
943
|
+
<span class="ruby-identifier">old_xf</span> = <span class="ruby-identifier">cell_xfs</span>[<span class="ruby-identifier">style_index</span>].<span class="ruby-identifier">dup</span>
|
944
|
+
<span class="ruby-identifier">new_border</span> = <span class="ruby-identifier">borders</span>[<span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">border_id</span>].<span class="ruby-identifier">dup</span>
|
945
|
+
<span class="ruby-identifier">new_border</span>.<span class="ruby-identifier">set_edge_style</span>(<span class="ruby-identifier">direction</span>, <span class="ruby-identifier">weight</span>)
|
946
|
+
|
947
|
+
<span class="ruby-identifier">new_xf</span> = <span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">dup</span>
|
948
|
+
|
949
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">borders</span>[<span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">border_id</span>].<span class="ruby-identifier">count</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">border_id</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span> <span class="ruby-comment"># If the old border not used anymore, just replace it</span>
|
950
|
+
<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">border_id</span> = <span class="ruby-identifier">borders</span>.<span class="ruby-identifier">find_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">new_border</span> } <span class="ruby-comment"># Use existing border, if it exists</span>
|
951
|
+
<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">border_id</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">borders</span>.<span class="ruby-identifier">size</span> <span class="ruby-comment"># If this border has never existed before, add it to collection.</span>
|
952
|
+
<span class="ruby-keyword">end</span>
|
953
|
+
|
954
|
+
<span class="ruby-identifier">borders</span>[<span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">border_id</span>].<span class="ruby-identifier">count</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
955
|
+
<span class="ruby-identifier">new_border</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
956
|
+
<span class="ruby-identifier">borders</span>[<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">border_id</span>] = <span class="ruby-identifier">new_border</span>
|
957
|
+
|
958
|
+
<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">apply_border</span> = <span class="ruby-keyword">true</span>
|
959
|
+
|
960
|
+
<span class="ruby-identifier">register_new_xf</span>(<span class="ruby-identifier">new_xf</span>, <span class="ruby-identifier">style_index</span>)
|
961
|
+
<span class="ruby-keyword">end</span></pre>
|
962
|
+
</div>
|
963
|
+
|
964
|
+
</div>
|
965
|
+
|
966
|
+
|
967
|
+
|
968
|
+
|
969
|
+
</div>
|
970
|
+
|
971
|
+
|
972
|
+
<div id="method-i-modify_fill" class="method-detail ">
|
973
|
+
|
974
|
+
<div class="method-heading">
|
975
|
+
<span class="method-name">modify_fill</span><span
|
976
|
+
class="method-args">(style_index, rgb)</span>
|
977
|
+
|
978
|
+
<span class="method-click-advice">click to toggle source</span>
|
979
|
+
|
980
|
+
</div>
|
981
|
+
|
982
|
+
|
983
|
+
<div class="method-description">
|
984
|
+
|
985
|
+
|
986
|
+
|
987
|
+
|
988
|
+
|
989
|
+
|
990
|
+
<div class="method-source-code" id="modify_fill-source">
|
991
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 218</span>
|
992
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">modify_fill</span>(<span class="ruby-identifier">style_index</span>, <span class="ruby-identifier">rgb</span>)
|
993
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">cell_xfs</span>[<span class="ruby-identifier">style_index</span>].<span class="ruby-identifier">dup</span>
|
994
|
+
<span class="ruby-identifier">new_fill</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Fill</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:pattern_fill</span> =<span class="ruby-operator">></span>
|
995
|
+
<span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">PatternFill</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:pattern_type</span> =<span class="ruby-operator">></span> <span class="ruby-string">'solid'</span>,
|
996
|
+
<span class="ruby-value">:fg_color</span> =<span class="ruby-operator">></span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Color</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:rgb</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">rgb</span>)))
|
997
|
+
<span class="ruby-identifier">new_xf</span> = <span class="ruby-identifier">register_new_fill</span>(<span class="ruby-identifier">new_fill</span>, <span class="ruby-identifier">xf</span>)
|
998
|
+
<span class="ruby-identifier">register_new_xf</span>(<span class="ruby-identifier">new_xf</span>, <span class="ruby-identifier">style_index</span>)
|
999
|
+
<span class="ruby-keyword">end</span></pre>
|
1000
|
+
</div>
|
1001
|
+
|
1002
|
+
</div>
|
1003
|
+
|
1004
|
+
|
1005
|
+
|
1006
|
+
|
1007
|
+
</div>
|
1008
|
+
|
1009
|
+
|
1010
|
+
<div id="method-i-modify_text_wrap" class="method-detail ">
|
1011
|
+
|
1012
|
+
<div class="method-heading">
|
1013
|
+
<span class="method-name">modify_text_wrap</span><span
|
1014
|
+
class="method-args">(style_index, wrap = false)</span>
|
1015
|
+
|
1016
|
+
<span class="method-click-advice">click to toggle source</span>
|
1017
|
+
|
1018
|
+
</div>
|
1019
|
+
|
1020
|
+
|
1021
|
+
<div class="method-description">
|
1022
|
+
|
1023
|
+
|
1024
|
+
|
1025
|
+
|
1026
|
+
|
1027
|
+
|
1028
|
+
<div class="method-source-code" id="modify_text_wrap-source">
|
1029
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 204</span>
|
1030
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">modify_text_wrap</span>(<span class="ruby-identifier">style_index</span>, <span class="ruby-identifier">wrap</span> = <span class="ruby-keyword">false</span>)
|
1031
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">cell_xfs</span>[<span class="ruby-identifier">style_index</span>].<span class="ruby-identifier">dup</span>
|
1032
|
+
<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">alignment</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Alignment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:wrap_text</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">wrap</span>, <span class="ruby-value">:apply_alignment</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">true</span>)
|
1033
|
+
<span class="ruby-identifier">register_new_xf</span>(<span class="ruby-identifier">xf</span>, <span class="ruby-identifier">style_index</span>)
|
1034
|
+
<span class="ruby-keyword">end</span></pre>
|
1035
|
+
</div>
|
1036
|
+
|
1037
|
+
</div>
|
1038
|
+
|
1039
|
+
|
1040
|
+
|
1041
|
+
|
1042
|
+
</div>
|
1043
|
+
|
1044
|
+
|
1045
|
+
<div id="method-i-num_to_date" class="method-detail ">
|
1046
|
+
|
1047
|
+
<div class="method-heading">
|
1048
|
+
<span class="method-name">num_to_date</span><span
|
1049
|
+
class="method-args">(num)</span>
|
1050
|
+
|
1051
|
+
<span class="method-click-advice">click to toggle source</span>
|
1052
|
+
|
1053
|
+
</div>
|
1054
|
+
|
1055
|
+
|
1056
|
+
<div class="method-description">
|
1057
|
+
|
1058
|
+
|
1059
|
+
|
1060
|
+
|
1061
|
+
|
1062
|
+
|
1063
|
+
<div class="method-source-code" id="num_to_date-source">
|
1064
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 150</span>
|
1065
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">num_to_date</span>(<span class="ruby-identifier">num</span>)
|
1066
|
+
<span class="ruby-identifier">num</span> <span class="ruby-operator">&&</span> (<span class="ruby-identifier">base_date</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">num</span>)
|
1067
|
+
<span class="ruby-keyword">end</span></pre>
|
1068
|
+
</div>
|
1069
|
+
|
1070
|
+
</div>
|
1071
|
+
|
1072
|
+
|
1073
|
+
|
1074
|
+
|
1075
|
+
</div>
|
1076
|
+
|
1077
|
+
|
1078
|
+
<div id="method-i-register_new_fill" class="method-detail ">
|
1079
|
+
|
1080
|
+
<div class="method-heading">
|
1081
|
+
<span class="method-name">register_new_fill</span><span
|
1082
|
+
class="method-args">(new_fill, old_xf)</span>
|
1083
|
+
|
1084
|
+
<span class="method-click-advice">click to toggle source</span>
|
1085
|
+
|
1086
|
+
</div>
|
1087
|
+
|
1088
|
+
|
1089
|
+
<div class="method-description">
|
1090
|
+
|
1091
|
+
|
1092
|
+
|
1093
|
+
|
1094
|
+
|
1095
|
+
|
1096
|
+
<div class="method-source-code" id="register_new_fill-source">
|
1097
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 161</span>
|
1098
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">register_new_fill</span>(<span class="ruby-identifier">new_fill</span>, <span class="ruby-identifier">old_xf</span>)
|
1099
|
+
<span class="ruby-identifier">new_xf</span> = <span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">dup</span>
|
1100
|
+
|
1101
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">fills</span>[<span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">fill_id</span>].<span class="ruby-identifier">count</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">fill_id</span> <span class="ruby-operator">></span> <span class="ruby-value">2</span> <span class="ruby-comment"># If the old fill is not used anymore, just replace it</span>
|
1102
|
+
<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">fill_id</span> = <span class="ruby-identifier">fills</span>.<span class="ruby-identifier">find_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">new_fill</span> } <span class="ruby-comment"># Use existing fill, if it exists</span>
|
1103
|
+
<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">fill_id</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">fills</span>.<span class="ruby-identifier">size</span> <span class="ruby-comment"># If this fill has never existed before, add it to collection.</span>
|
1104
|
+
<span class="ruby-keyword">end</span>
|
1105
|
+
|
1106
|
+
<span class="ruby-identifier">fills</span>[<span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">fill_id</span>].<span class="ruby-identifier">count</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
1107
|
+
<span class="ruby-identifier">new_fill</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
1108
|
+
<span class="ruby-identifier">fills</span>[<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">fill_id</span>] = <span class="ruby-identifier">new_fill</span>
|
1109
|
+
|
1110
|
+
<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">apply_fill</span> = <span class="ruby-keyword">true</span>
|
1111
|
+
<span class="ruby-identifier">new_xf</span>
|
1112
|
+
<span class="ruby-keyword">end</span></pre>
|
1113
|
+
</div>
|
1114
|
+
|
1115
|
+
</div>
|
1116
|
+
|
1117
|
+
|
1118
|
+
|
1119
|
+
|
1120
|
+
</div>
|
1121
|
+
|
1122
|
+
|
1123
|
+
<div id="method-i-register_new_font" class="method-detail ">
|
1124
|
+
|
1125
|
+
<div class="method-heading">
|
1126
|
+
<span class="method-name">register_new_font</span><span
|
1127
|
+
class="method-args">(new_font, old_xf)</span>
|
1128
|
+
|
1129
|
+
<span class="method-click-advice">click to toggle source</span>
|
1130
|
+
|
1131
|
+
</div>
|
1132
|
+
|
1133
|
+
|
1134
|
+
<div class="method-description">
|
1135
|
+
|
1136
|
+
|
1137
|
+
|
1138
|
+
|
1139
|
+
|
1140
|
+
|
1141
|
+
<div class="method-source-code" id="register_new_font-source">
|
1142
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 177</span>
|
1143
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">register_new_font</span>(<span class="ruby-identifier">new_font</span>, <span class="ruby-identifier">old_xf</span>)
|
1144
|
+
<span class="ruby-identifier">new_xf</span> = <span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">dup</span>
|
1145
|
+
|
1146
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">fonts</span>[<span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">font_id</span>].<span class="ruby-identifier">count</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">font_id</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span> <span class="ruby-comment"># If the old font is not used anymore, just replace it</span>
|
1147
|
+
<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">font_id</span> = <span class="ruby-identifier">fonts</span>.<span class="ruby-identifier">find_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">new_font</span> } <span class="ruby-comment"># Use existing font, if it exists</span>
|
1148
|
+
<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">font_id</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">fonts</span>.<span class="ruby-identifier">size</span> <span class="ruby-comment"># If this font has never existed before, add it to collection.</span>
|
1149
|
+
<span class="ruby-keyword">end</span>
|
1150
|
+
|
1151
|
+
<span class="ruby-identifier">fonts</span>[<span class="ruby-identifier">old_xf</span>.<span class="ruby-identifier">font_id</span>].<span class="ruby-identifier">count</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
1152
|
+
<span class="ruby-identifier">new_font</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
1153
|
+
<span class="ruby-identifier">fonts</span>[<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">font_id</span>] = <span class="ruby-identifier">new_font</span>
|
1154
|
+
|
1155
|
+
<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">apply_font</span> = <span class="ruby-keyword">true</span>
|
1156
|
+
<span class="ruby-identifier">new_xf</span>
|
1157
|
+
<span class="ruby-keyword">end</span></pre>
|
1158
|
+
</div>
|
1159
|
+
|
1160
|
+
</div>
|
1161
|
+
|
1162
|
+
|
1163
|
+
|
1164
|
+
|
1165
|
+
</div>
|
1166
|
+
|
1167
|
+
|
1168
|
+
<div id="method-i-register_new_xf" class="method-detail ">
|
1169
|
+
|
1170
|
+
<div class="method-heading">
|
1171
|
+
<span class="method-name">register_new_xf</span><span
|
1172
|
+
class="method-args">(new_xf, old_style_index)</span>
|
1173
|
+
|
1174
|
+
<span class="method-click-advice">click to toggle source</span>
|
1175
|
+
|
1176
|
+
</div>
|
1177
|
+
|
1178
|
+
|
1179
|
+
<div class="method-description">
|
1180
|
+
|
1181
|
+
|
1182
|
+
|
1183
|
+
|
1184
|
+
|
1185
|
+
|
1186
|
+
<div class="method-source-code" id="register_new_xf-source">
|
1187
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 193</span>
|
1188
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">register_new_xf</span>(<span class="ruby-identifier">new_xf</span>, <span class="ruby-identifier">old_style_index</span>)
|
1189
|
+
<span class="ruby-identifier">new_xf_id</span> = <span class="ruby-identifier">cell_xfs</span>.<span class="ruby-identifier">find_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">xf</span><span class="ruby-operator">|</span> <span class="ruby-identifier">xf</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">new_xf</span> } <span class="ruby-comment"># Use existing XF, if it exists</span>
|
1190
|
+
<span class="ruby-identifier">new_xf_id</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">cell_xfs</span>.<span class="ruby-identifier">size</span> <span class="ruby-comment"># If this XF has never existed before, add it to collection.</span>
|
1191
|
+
|
1192
|
+
<span class="ruby-identifier">cell_xfs</span>[<span class="ruby-identifier">old_style_index</span>].<span class="ruby-identifier">count</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
1193
|
+
<span class="ruby-identifier">new_xf</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
1194
|
+
<span class="ruby-identifier">cell_xfs</span>[<span class="ruby-identifier">new_xf_id</span>] = <span class="ruby-identifier">new_xf</span>
|
1195
|
+
|
1196
|
+
<span class="ruby-identifier">new_xf_id</span>
|
1197
|
+
<span class="ruby-keyword">end</span></pre>
|
1198
|
+
</div>
|
1199
|
+
|
1200
|
+
</div>
|
1201
|
+
|
1202
|
+
|
1203
|
+
|
1204
|
+
|
1205
|
+
</div>
|
1206
|
+
|
1207
|
+
|
1208
|
+
<div id="method-i-write" class="method-detail ">
|
1209
|
+
|
1210
|
+
<div class="method-heading">
|
1211
|
+
<span class="method-name">write</span><span
|
1212
|
+
class="method-args">(filepath = @filepath)</span>
|
1213
|
+
|
1214
|
+
<span class="method-click-advice">click to toggle source</span>
|
1215
|
+
|
1216
|
+
</div>
|
1217
|
+
|
1218
|
+
|
1219
|
+
<div class="method-description">
|
1220
|
+
|
1221
|
+
<p>filepath of xlsx file (including file itself)</p>
|
1222
|
+
|
1223
|
+
|
1224
|
+
|
1225
|
+
|
1226
|
+
<div class="method-source-code" id="write-source">
|
1227
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/workbook.rb, line 101</span>
|
1228
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">filepath</span> = <span class="ruby-ivar">@filepath</span>)
|
1229
|
+
<span class="ruby-identifier">extension</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-identifier">filepath</span>)
|
1230
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-node">%w{.xlsx .xlsm}</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">extension</span>)
|
1231
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Only xlsx and xlsm files are supported. Unsupported extension: #{extension}"</span>
|
1232
|
+
<span class="ruby-keyword">end</span>
|
1233
|
+
|
1234
|
+
<span class="ruby-identifier">dirpath</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">filepath</span>)
|
1235
|
+
<span class="ruby-identifier">temppath</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">dirpath</span>, <span class="ruby-constant">Dir</span><span class="ruby-operator">::</span><span class="ruby-constant">Tmpname</span>.<span class="ruby-identifier">make_tmpname</span>([ <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">filepath</span>), <span class="ruby-string">'.tmp'</span> ], <span class="ruby-keyword">nil</span>))
|
1236
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">temppath</span>)
|
1237
|
+
<span class="ruby-identifier">zippath</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">temppath</span>, <span class="ruby-string">'file.zip'</span>)
|
1238
|
+
|
1239
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">Zip</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">zippath</span>, <span class="ruby-operator">::</span><span class="ruby-constant">Zip</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">CREATE</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">zipfile</span><span class="ruby-operator">|</span>
|
1240
|
+
[ <span class="ruby-constant">Writer</span><span class="ruby-operator">::</span><span class="ruby-constant">ContentTypesWriter</span>, <span class="ruby-constant">Writer</span><span class="ruby-operator">::</span><span class="ruby-constant">RootRelsWriter</span>, <span class="ruby-constant">Writer</span><span class="ruby-operator">::</span><span class="ruby-constant">CoreWriter</span>,
|
1241
|
+
<span class="ruby-constant">Writer</span><span class="ruby-operator">::</span><span class="ruby-constant">ThemeWriter</span>, <span class="ruby-constant">Writer</span><span class="ruby-operator">::</span><span class="ruby-constant">WorkbookWriter</span>, <span class="ruby-constant">Writer</span><span class="ruby-operator">::</span><span class="ruby-constant">StylesWriter</span>
|
1242
|
+
].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">writer_class</span><span class="ruby-operator">|</span> <span class="ruby-identifier">writer_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>).<span class="ruby-identifier">add_to_zip</span>(<span class="ruby-identifier">zipfile</span>) }
|
1243
|
+
|
1244
|
+
<span class="ruby-identifier">calculation_chain</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">calculation_chain</span>.<span class="ruby-identifier">add_to_zip</span>(<span class="ruby-identifier">zipfile</span>)
|
1245
|
+
<span class="ruby-identifier">shared_strings_container</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">shared_strings_container</span>.<span class="ruby-identifier">add_to_zip</span>(<span class="ruby-identifier">zipfile</span>)
|
1246
|
+
<span class="ruby-identifier">document_properties</span>.<span class="ruby-identifier">add_to_zip</span>(<span class="ruby-identifier">zipfile</span>)
|
1247
|
+
<span class="ruby-identifier">relationship_container</span>.<span class="ruby-identifier">workbook</span> = <span class="ruby-keyword">self</span>
|
1248
|
+
<span class="ruby-identifier">relationship_container</span>.<span class="ruby-identifier">add_to_zip</span>(<span class="ruby-identifier">zipfile</span>)
|
1249
|
+
|
1250
|
+
[ <span class="ruby-ivar">@media</span>, <span class="ruby-ivar">@external_links</span>, <span class="ruby-ivar">@external_links_rels</span>,
|
1251
|
+
<span class="ruby-ivar">@drawings</span>, <span class="ruby-ivar">@drawings_rels</span>, <span class="ruby-ivar">@charts</span>, <span class="ruby-ivar">@chart_rels</span>,
|
1252
|
+
<span class="ruby-ivar">@printer_settings</span>, <span class="ruby-ivar">@worksheet_rels</span>, <span class="ruby-ivar">@chartsheet_rels</span>, <span class="ruby-ivar">@macros</span> ].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">add_to_zip</span>(<span class="ruby-identifier">zipfile</span>) }
|
1253
|
+
|
1254
|
+
<span class="ruby-ivar">@worksheets</span>.<span class="ruby-identifier">each_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-constant">Writer</span><span class="ruby-operator">::</span><span class="ruby-constant">WorksheetWriter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">i</span>).<span class="ruby-identifier">add_to_zip</span>(<span class="ruby-identifier">zipfile</span>) }
|
1255
|
+
}
|
1256
|
+
|
1257
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mv</span>(<span class="ruby-identifier">zippath</span>, <span class="ruby-identifier">filepath</span>)
|
1258
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-identifier">temppath</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">filepath</span>)
|
1259
|
+
|
1260
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">filepath</span>
|
1261
|
+
<span class="ruby-keyword">end</span></pre>
|
1262
|
+
</div>
|
1263
|
+
|
1264
|
+
</div>
|
1265
|
+
|
1266
|
+
|
1267
|
+
|
1268
|
+
|
1269
|
+
</div>
|
1270
|
+
|
1271
|
+
|
1272
|
+
</section>
|
1273
|
+
|
1274
|
+
</section>
|
1275
|
+
</main>
|
1276
|
+
|
1277
|
+
|
1278
|
+
<footer id="validator-badges" role="contentinfo">
|
1279
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
1280
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
1281
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
1282
|
+
</footer>
|
1283
|
+
|