rubyXL 2.1.1 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. data/VERSION +1 -1
  2. data/lib/rubyXL.rb +1 -0
  3. data/lib/rubyXL/objects/border.rb +3 -4
  4. data/lib/rubyXL/objects/calculation_chain.rb +1 -1
  5. data/lib/rubyXL/objects/cell_style.rb +3 -4
  6. data/lib/rubyXL/objects/chartsheet.rb +78 -0
  7. data/lib/rubyXL/objects/container_nodes.rb +2 -3
  8. data/lib/rubyXL/objects/data_validation.rb +5 -10
  9. data/lib/rubyXL/objects/document_properties.rb +1 -1
  10. data/lib/rubyXL/objects/fill.rb +3 -6
  11. data/lib/rubyXL/objects/filters.rb +120 -0
  12. data/lib/rubyXL/objects/formula.rb +2 -2
  13. data/lib/rubyXL/objects/ooxml_object.rb +116 -56
  14. data/lib/rubyXL/objects/relationships.rb +5 -1
  15. data/lib/rubyXL/objects/shared_strings.rb +1 -1
  16. data/lib/rubyXL/objects/sheet_common.rb +50 -0
  17. data/lib/rubyXL/objects/sheet_data.rb +6 -1
  18. data/lib/rubyXL/objects/simple_types.rb +78 -0
  19. data/lib/rubyXL/objects/stylesheet.rb +15 -3
  20. data/lib/rubyXL/objects/text.rb +4 -5
  21. data/lib/rubyXL/objects/workbook.rb +151 -26
  22. data/lib/rubyXL/objects/worksheet.rb +329 -107
  23. data/lib/rubyXL/parser.rb +12 -11
  24. data/lib/rubyXL/workbook.rb +3 -2
  25. data/rdoc/README_rdoc.html +404 -0
  26. data/rdoc/RubyXL.html +337 -0
  27. data/rdoc/RubyXL/AExtensionStorageArea.html +105 -0
  28. data/rdoc/RubyXL/Alignment.html +108 -0
  29. data/rdoc/RubyXL/AlternateContent.html +105 -0
  30. data/rdoc/RubyXL/AutoFilter.html +105 -0
  31. data/rdoc/RubyXL/AutoFilterColumn.html +105 -0
  32. data/rdoc/RubyXL/BooleanNode.html +105 -0
  33. data/rdoc/RubyXL/BooleanValue.html +105 -0
  34. data/rdoc/RubyXL/Border.html +105 -0
  35. data/rdoc/RubyXL/BorderContainer.html +105 -0
  36. data/rdoc/RubyXL/BorderEdge.html +156 -0
  37. data/rdoc/RubyXL/Break.html +105 -0
  38. data/rdoc/RubyXL/BreakList.html +105 -0
  39. data/rdoc/RubyXL/CalculationChain.html +159 -0
  40. data/rdoc/RubyXL/CalculationChainCell.html +108 -0
  41. data/rdoc/RubyXL/CalculationProperties.html +105 -0
  42. data/rdoc/RubyXL/Cell.html +428 -0
  43. data/rdoc/RubyXL/CellSmartTag.html +105 -0
  44. data/rdoc/RubyXL/CellSmartTagContainer.html +105 -0
  45. data/rdoc/RubyXL/CellSmartTagProperty.html +105 -0
  46. data/rdoc/RubyXL/CellStyle.html +108 -0
  47. data/rdoc/RubyXL/CellStyleContainer.html +105 -0
  48. data/rdoc/RubyXL/CellStyleXFContainer.html +105 -0
  49. data/rdoc/RubyXL/CellValue.html +108 -0
  50. data/rdoc/RubyXL/CellWatch.html +105 -0
  51. data/rdoc/RubyXL/CellWatchContainer.html +105 -0
  52. data/rdoc/RubyXL/CellXFContainer.html +105 -0
  53. data/rdoc/RubyXL/Chartsheet.html +105 -0
  54. data/rdoc/RubyXL/ChartsheetPageSetup.html +105 -0
  55. data/rdoc/RubyXL/ChartsheetProperties.html +108 -0
  56. data/rdoc/RubyXL/ChartsheetProtection.html +108 -0
  57. data/rdoc/RubyXL/ChartsheetView.html +105 -0
  58. data/rdoc/RubyXL/ChartsheetViewContainer.html +105 -0
  59. data/rdoc/RubyXL/Color.html +163 -0
  60. data/rdoc/RubyXL/ColorFilter.html +105 -0
  61. data/rdoc/RubyXL/ColorScale.html +105 -0
  62. data/rdoc/RubyXL/ColorScheme.html +105 -0
  63. data/rdoc/RubyXL/ColorSet.html +105 -0
  64. data/rdoc/RubyXL/Colors.html +105 -0
  65. data/rdoc/RubyXL/ColumnRange.html +233 -0
  66. data/rdoc/RubyXL/ColumnRanges.html +275 -0
  67. data/rdoc/RubyXL/ConditionalFormatValue.html +105 -0
  68. data/rdoc/RubyXL/ConditionalFormatting.html +105 -0
  69. data/rdoc/RubyXL/ConditionalFormattingRule.html +105 -0
  70. data/rdoc/RubyXL/CustomFilter.html +105 -0
  71. data/rdoc/RubyXL/CustomFilterContainer.html +105 -0
  72. data/rdoc/RubyXL/CustomProperty.html +105 -0
  73. data/rdoc/RubyXL/CustomPropertyContainer.html +105 -0
  74. data/rdoc/RubyXL/CustomSheetView.html +105 -0
  75. data/rdoc/RubyXL/CustomSheetViews.html +105 -0
  76. data/rdoc/RubyXL/CustomWorkbookView.html +105 -0
  77. data/rdoc/RubyXL/CustomWorkbookViewContainer.html +105 -0
  78. data/rdoc/RubyXL/DXF.html +105 -0
  79. data/rdoc/RubyXL/DXFs.html +105 -0
  80. data/rdoc/RubyXL/DataBar.html +105 -0
  81. data/rdoc/RubyXL/DataConsolidate.html +105 -0
  82. data/rdoc/RubyXL/DataConsolidationReference.html +105 -0
  83. data/rdoc/RubyXL/DataConsolidationReferences.html +105 -0
  84. data/rdoc/RubyXL/DataValidation.html +108 -0
  85. data/rdoc/RubyXL/DataValidations.html +105 -0
  86. data/rdoc/RubyXL/DateGroupItem.html +108 -0
  87. data/rdoc/RubyXL/DefinedName.html +105 -0
  88. data/rdoc/RubyXL/DefinedNames.html +105 -0
  89. data/rdoc/RubyXL/DocumentProperties.html +271 -0
  90. data/rdoc/RubyXL/DynamicFilter.html +105 -0
  91. data/rdoc/RubyXL/EmbeddedControl.html +105 -0
  92. data/rdoc/RubyXL/EmbeddedControlContainer.html +105 -0
  93. data/rdoc/RubyXL/Extension.html +228 -0
  94. data/rdoc/RubyXL/ExtensionStorageArea.html +108 -0
  95. data/rdoc/RubyXL/ExternalReference.html +105 -0
  96. data/rdoc/RubyXL/ExternalReferences.html +105 -0
  97. data/rdoc/RubyXL/FieldItem.html +105 -0
  98. data/rdoc/RubyXL/FileRecoveryProperties.html +105 -0
  99. data/rdoc/RubyXL/FileSharing.html +108 -0
  100. data/rdoc/RubyXL/FileVersion.html +108 -0
  101. data/rdoc/RubyXL/Fill.html +105 -0
  102. data/rdoc/RubyXL/FillContainer.html +105 -0
  103. data/rdoc/RubyXL/FilterContainer.html +105 -0
  104. data/rdoc/RubyXL/FloatNode.html +105 -0
  105. data/rdoc/RubyXL/FloatValue.html +105 -0
  106. data/rdoc/RubyXL/Font.html +655 -0
  107. data/rdoc/RubyXL/FontContainer.html +105 -0
  108. data/rdoc/RubyXL/FontScheme.html +105 -0
  109. data/rdoc/RubyXL/FormatScheme.html +105 -0
  110. data/rdoc/RubyXL/Formula.html +108 -0
  111. data/rdoc/RubyXL/FunctionGroup.html +105 -0
  112. data/rdoc/RubyXL/FunctionGroupContainer.html +105 -0
  113. data/rdoc/RubyXL/GenericStorage.html +344 -0
  114. data/rdoc/RubyXL/GradientFill.html +105 -0
  115. data/rdoc/RubyXL/HeaderFooterSettings.html +105 -0
  116. data/rdoc/RubyXL/Hyperlink.html +105 -0
  117. data/rdoc/RubyXL/HyperlinkContainer.html +105 -0
  118. data/rdoc/RubyXL/IconFilter.html +105 -0
  119. data/rdoc/RubyXL/IconSet.html +105 -0
  120. data/rdoc/RubyXL/IgnoredError.html +105 -0
  121. data/rdoc/RubyXL/IgnoredErrorContainer.html +105 -0
  122. data/rdoc/RubyXL/IndexedColorContainer.html +105 -0
  123. data/rdoc/RubyXL/InputCells.html +105 -0
  124. data/rdoc/RubyXL/IntegerNode.html +105 -0
  125. data/rdoc/RubyXL/IntegerValue.html +105 -0
  126. data/rdoc/RubyXL/LegacyCell.html +1498 -0
  127. data/rdoc/RubyXL/LegacyWorkbook.html +1283 -0
  128. data/rdoc/RubyXL/LegacyWorksheet.html +3291 -0
  129. data/rdoc/RubyXL/MRUColorContainer.html +105 -0
  130. data/rdoc/RubyXL/MergedCell.html +105 -0
  131. data/rdoc/RubyXL/MergedCells.html +105 -0
  132. data/rdoc/RubyXL/NumFmt.html +105 -0
  133. data/rdoc/RubyXL/NumberFormat.html +160 -0
  134. data/rdoc/RubyXL/NumberFormatContainer.html +173 -0
  135. data/rdoc/RubyXL/OLEObject.html +105 -0
  136. data/rdoc/RubyXL/OLEObjects.html +105 -0
  137. data/rdoc/RubyXL/OLESize.html +105 -0
  138. data/rdoc/RubyXL/OOXMLObject.html +862 -0
  139. data/rdoc/RubyXL/OOXMLTopLevelObject.html +105 -0
  140. data/rdoc/RubyXL/OutlineProperties.html +108 -0
  141. data/rdoc/RubyXL/PageMargins.html +105 -0
  142. data/rdoc/RubyXL/PageSetup.html +105 -0
  143. data/rdoc/RubyXL/PageSetupProperties.html +108 -0
  144. data/rdoc/RubyXL/Pane.html +105 -0
  145. data/rdoc/RubyXL/Parser.html +348 -0
  146. data/rdoc/RubyXL/PatternFill.html +105 -0
  147. data/rdoc/RubyXL/PhoneticProperties.html +105 -0
  148. data/rdoc/RubyXL/PhoneticRun.html +105 -0
  149. data/rdoc/RubyXL/PivotArea.html +105 -0
  150. data/rdoc/RubyXL/PivotCache.html +105 -0
  151. data/rdoc/RubyXL/PivotCaches.html +105 -0
  152. data/rdoc/RubyXL/PivotReference.html +105 -0
  153. data/rdoc/RubyXL/PivotReferenceContainer.html +105 -0
  154. data/rdoc/RubyXL/PivotTableSelection.html +105 -0
  155. data/rdoc/RubyXL/PrintOptions.html +105 -0
  156. data/rdoc/RubyXL/ProtectedRange.html +105 -0
  157. data/rdoc/RubyXL/ProtectedRanges.html +105 -0
  158. data/rdoc/RubyXL/Protection.html +105 -0
  159. data/rdoc/RubyXL/RID.html +105 -0
  160. data/rdoc/RubyXL/RawOOXML.html +225 -0
  161. data/rdoc/RubyXL/Reference.html +642 -0
  162. data/rdoc/RubyXL/Relationship.html +105 -0
  163. data/rdoc/RubyXL/RichText.html +105 -0
  164. data/rdoc/RubyXL/RichTextRun.html +105 -0
  165. data/rdoc/RubyXL/Row.html +105 -0
  166. data/rdoc/RubyXL/RunProperties.html +108 -0
  167. data/rdoc/RubyXL/Scenario.html +105 -0
  168. data/rdoc/RubyXL/ScenarioContainer.html +105 -0
  169. data/rdoc/RubyXL/Selection.html +105 -0
  170. data/rdoc/RubyXL/SharedStringsTable.html +397 -0
  171. data/rdoc/RubyXL/Sheet.html +105 -0
  172. data/rdoc/RubyXL/SheetCalculationProperties.html +105 -0
  173. data/rdoc/RubyXL/SheetData.html +105 -0
  174. data/rdoc/RubyXL/Sheets.html +105 -0
  175. data/rdoc/RubyXL/SmartTagContainer.html +105 -0
  176. data/rdoc/RubyXL/SmartTagProperties.html +105 -0
  177. data/rdoc/RubyXL/SmartTagType.html +105 -0
  178. data/rdoc/RubyXL/SmartTagTypeContainer.html +105 -0
  179. data/rdoc/RubyXL/SortCondition.html +105 -0
  180. data/rdoc/RubyXL/SortState.html +105 -0
  181. data/rdoc/RubyXL/Sqref.html +199 -0
  182. data/rdoc/RubyXL/Stop.html +108 -0
  183. data/rdoc/RubyXL/StringNode.html +105 -0
  184. data/rdoc/RubyXL/StringValue.html +105 -0
  185. data/rdoc/RubyXL/Stylesheet.html +105 -0
  186. data/rdoc/RubyXL/TableParts.html +105 -0
  187. data/rdoc/RubyXL/TableStyle.html +105 -0
  188. data/rdoc/RubyXL/TableStyles.html +105 -0
  189. data/rdoc/RubyXL/Text.html +195 -0
  190. data/rdoc/RubyXL/Theme.html +105 -0
  191. data/rdoc/RubyXL/ThemeElements.html +105 -0
  192. data/rdoc/RubyXL/Top10.html +105 -0
  193. data/rdoc/RubyXL/Variant.html +108 -0
  194. data/rdoc/RubyXL/Vector.html +105 -0
  195. data/rdoc/RubyXL/VectorValue.html +105 -0
  196. data/rdoc/RubyXL/WebPublishObject.html +105 -0
  197. data/rdoc/RubyXL/WebPublishObjectContainer.html +105 -0
  198. data/rdoc/RubyXL/WebPublishingItem.html +108 -0
  199. data/rdoc/RubyXL/WebPublishingItemContainer.html +105 -0
  200. data/rdoc/RubyXL/WebPublishingProperties.html +105 -0
  201. data/rdoc/RubyXL/Workbook.html +105 -0
  202. data/rdoc/RubyXL/WorkbookProperties.html +108 -0
  203. data/rdoc/RubyXL/WorkbookProtection.html +105 -0
  204. data/rdoc/RubyXL/WorkbookRelationships.html +316 -0
  205. data/rdoc/RubyXL/WorkbookView.html +105 -0
  206. data/rdoc/RubyXL/WorkbookViews.html +105 -0
  207. data/rdoc/RubyXL/Worksheet.html +105 -0
  208. data/rdoc/RubyXL/WorksheetDimensions.html +105 -0
  209. data/rdoc/RubyXL/WorksheetFormatProperties.html +105 -0
  210. data/rdoc/RubyXL/WorksheetProperties.html +108 -0
  211. data/rdoc/RubyXL/WorksheetProtection.html +105 -0
  212. data/rdoc/RubyXL/WorksheetView.html +105 -0
  213. data/rdoc/RubyXL/WorksheetViews.html +105 -0
  214. data/rdoc/RubyXL/Writer.html +98 -0
  215. data/rdoc/RubyXL/Writer/ContentTypesWriter.html +289 -0
  216. data/rdoc/RubyXL/Writer/CoreWriter.html +210 -0
  217. data/rdoc/RubyXL/Writer/GenericWriter.html +348 -0
  218. data/rdoc/RubyXL/Writer/RootRelsWriter.html +193 -0
  219. data/rdoc/RubyXL/Writer/StylesWriter.html +191 -0
  220. data/rdoc/RubyXL/Writer/ThemeWriter.html +511 -0
  221. data/rdoc/RubyXL/Writer/WorkbookWriter.html +249 -0
  222. data/rdoc/RubyXL/Writer/WorksheetWriter.html +236 -0
  223. data/rdoc/RubyXL/XF.html +105 -0
  224. data/rdoc/created.rid +24 -21
  225. data/rdoc/index.html +216 -0
  226. data/rdoc/js/search_index.js +1 -1
  227. data/rdoc/table_of_contents.html +1496 -0
  228. data/rubyXL.gemspec +211 -4
  229. data/spec/lib/parser_spec.rb +18 -6
  230. data/test/input/.gitkeep +0 -0
  231. data/test/output/.gitkeep +0 -0
  232. data/test/test_parse_write.rb +15 -0
  233. metadata +211 -4
  234. data/lib/rubyXL/objects/sheet_view.rb +0 -71
@@ -0,0 +1,642 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class RubyXL::Reference - 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="class">
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
+ <div id="parent-class-section" class="nav-section">
61
+ <h3>Parent</h3>
62
+
63
+
64
+ <p class="link">Object
65
+
66
+ </div>
67
+
68
+
69
+
70
+ <!-- Method Quickref -->
71
+ <div id="method-list-section" class="nav-section">
72
+ <h3>Methods</h3>
73
+
74
+ <ul class="link-list" role="directory">
75
+
76
+ <li ><a href="#method-c-ind2ref">::ind2ref</a>
77
+
78
+ <li ><a href="#method-c-new">::new</a>
79
+
80
+ <li ><a href="#method-c-ref2ind">::ref2ind</a>
81
+
82
+ <li ><a href="#method-i-3D-3D">#==</a>
83
+
84
+ <li ><a href="#method-i-cover-3F">#cover?</a>
85
+
86
+ <li ><a href="#method-i-first_col">#first_col</a>
87
+
88
+ <li ><a href="#method-i-first_row">#first_row</a>
89
+
90
+ <li ><a href="#method-i-inspect">#inspect</a>
91
+
92
+ <li ><a href="#method-i-last_col">#last_col</a>
93
+
94
+ <li ><a href="#method-i-last_row">#last_row</a>
95
+
96
+ <li ><a href="#method-i-single_cell-3F">#single_cell?</a>
97
+
98
+ <li ><a href="#method-i-to_s">#to_s</a>
99
+
100
+ </ul>
101
+ </div>
102
+
103
+ </div>
104
+ </nav>
105
+
106
+ <main role="main" aria-labelledby="class-RubyXL::Reference">
107
+ <h1 id="class-RubyXL::Reference" class="class">
108
+ class RubyXL::Reference
109
+ </h1>
110
+
111
+ <section class="description">
112
+
113
+ </section>
114
+
115
+
116
+
117
+
118
+ <section id="5Buntitled-5D" class="documentation-section">
119
+
120
+
121
+
122
+
123
+
124
+ <section class="constants-list">
125
+ <header>
126
+ <h3>Constants</h3>
127
+ </header>
128
+ <dl>
129
+
130
+ <dt id="COL_MAX">COL_MAX
131
+
132
+ <dd>
133
+
134
+
135
+ <dt id="ROW_MAX">ROW_MAX
136
+
137
+ <dd>
138
+
139
+
140
+ </dl>
141
+ </section>
142
+
143
+
144
+
145
+ <section class="attribute-method-details" class="method-section">
146
+ <header>
147
+ <h3>Attributes</h3>
148
+ </header>
149
+
150
+
151
+ <div id="attribute-i-col_range" class="method-detail">
152
+ <div class="method-heading attribute-method-heading">
153
+ <span class="method-name">col_range</span><span
154
+ class="attribute-access-type">[R]</span>
155
+ </div>
156
+
157
+ <div class="method-description">
158
+
159
+
160
+
161
+ </div>
162
+ </div>
163
+
164
+ <div id="attribute-i-row_range" class="method-detail">
165
+ <div class="method-heading attribute-method-heading">
166
+ <span class="method-name">row_range</span><span
167
+ class="attribute-access-type">[R]</span>
168
+ </div>
169
+
170
+ <div class="method-description">
171
+
172
+
173
+
174
+ </div>
175
+ </div>
176
+
177
+ </section>
178
+
179
+
180
+
181
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
182
+ <header>
183
+ <h3>Public Class Methods</h3>
184
+ </header>
185
+
186
+
187
+ <div id="method-c-ind2ref" class="method-detail ">
188
+
189
+ <div class="method-heading">
190
+ <span class="method-name">ind2ref</span><span
191
+ class="method-args">(row = 0, col = 0)</span>
192
+
193
+ <span class="method-click-advice">click to toggle source</span>
194
+
195
+ </div>
196
+
197
+
198
+ <div class="method-description">
199
+
200
+ <p>Converts <code>row</code> and <code>col</code> zero-based indices to
201
+ Excel-style cell reference (0) A…Z, AA…AZ, BA… …ZZ, AAA… …AZZ, BAA… …XFD
202
+ (16383)</p>
203
+
204
+
205
+
206
+
207
+ <div class="method-source-code" id="ind2ref-source">
208
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 75</span>
209
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ind2ref</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
210
+ <span class="ruby-identifier">str</span> = <span class="ruby-string">''</span>
211
+
212
+ <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
213
+ <span class="ruby-identifier">x</span> = <span class="ruby-identifier">col</span> <span class="ruby-operator">%</span> <span class="ruby-value">26</span>
214
+ <span class="ruby-identifier">str</span> = (<span class="ruby-string">'A'</span>.<span class="ruby-identifier">ord</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">x</span>).<span class="ruby-identifier">chr</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">str</span>
215
+ <span class="ruby-identifier">col</span> = (<span class="ruby-identifier">col</span> <span class="ruby-operator">/</span> <span class="ruby-value">26</span>).<span class="ruby-identifier">floor</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
216
+ <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">col</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
217
+ <span class="ruby-keyword">end</span>
218
+
219
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">row</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_s</span>
220
+ <span class="ruby-keyword">end</span></pre>
221
+ </div>
222
+
223
+ </div>
224
+
225
+
226
+
227
+
228
+ </div>
229
+
230
+
231
+ <div id="method-c-new" class="method-detail ">
232
+
233
+ <div class="method-heading">
234
+ <span class="method-name">new</span><span
235
+ class="method-args">(*params)</span>
236
+
237
+ <span class="method-click-advice">click to toggle source</span>
238
+
239
+ </div>
240
+
241
+
242
+ <div class="method-description">
243
+
244
+ <p><a href="Reference.html#method-c-new">::new</a>(row, col) <a
245
+ href="Reference.html#method-c-new">::new</a>(row_from, row_to, col_from,
246
+ col_to) <a href="Reference.html#method-c-new">::new</a></p>
247
+
248
+
249
+
250
+
251
+ <div class="method-source-code" id="new-source">
252
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 11</span>
253
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">params</span>)
254
+ <span class="ruby-identifier">row_from</span> = <span class="ruby-identifier">row_to</span> = <span class="ruby-identifier">col_from</span> = <span class="ruby-identifier">col_to</span> = <span class="ruby-keyword">nil</span>
255
+
256
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">size</span>
257
+ <span class="ruby-keyword">when</span> <span class="ruby-value">4</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">row_from</span>, <span class="ruby-identifier">row_to</span>, <span class="ruby-identifier">col_from</span>, <span class="ruby-identifier">col_to</span> = <span class="ruby-identifier">params</span>
258
+ <span class="ruby-keyword">when</span> <span class="ruby-value">2</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">row_from</span>, <span class="ruby-identifier">col_from</span> = <span class="ruby-identifier">params</span>
259
+ <span class="ruby-keyword">when</span> <span class="ruby-value">1</span> <span class="ruby-keyword">then</span>
260
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;invalid value for #{self.class}: #{params[0].inspect}&quot;</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
261
+ <span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">':'</span>)
262
+ <span class="ruby-identifier">row_from</span>, <span class="ruby-identifier">col_from</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ref2ind</span>(<span class="ruby-identifier">from</span>)
263
+ <span class="ruby-identifier">row_to</span>, <span class="ruby-identifier">col_to</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ref2ind</span>(<span class="ruby-identifier">to</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">to</span>.<span class="ruby-identifier">nil?</span>
264
+ <span class="ruby-keyword">end</span>
265
+
266
+ <span class="ruby-ivar">@row_range</span> = <span class="ruby-constant">Range</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">row_from</span> <span class="ruby-operator">||</span> <span class="ruby-value">0</span>, <span class="ruby-identifier">row_to</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">row_from</span> <span class="ruby-operator">||</span> <span class="ruby-constant">ROW_MAX</span>)
267
+ <span class="ruby-ivar">@col_range</span> = <span class="ruby-constant">Range</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">col_from</span> <span class="ruby-operator">||</span> <span class="ruby-value">0</span>, <span class="ruby-identifier">col_to</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">col_from</span> <span class="ruby-operator">||</span> <span class="ruby-constant">COL_MAX</span>)
268
+ <span class="ruby-keyword">end</span></pre>
269
+ </div>
270
+
271
+ </div>
272
+
273
+
274
+
275
+
276
+ </div>
277
+
278
+
279
+ <div id="method-c-ref2ind" class="method-detail ">
280
+
281
+ <div class="method-heading">
282
+ <span class="method-name">ref2ind</span><span
283
+ class="method-args">(str)</span>
284
+
285
+ <span class="method-click-advice">click to toggle source</span>
286
+
287
+ </div>
288
+
289
+
290
+ <div class="method-description">
291
+
292
+ <p>Converts Excel-style cell reference to <code>row</code> and
293
+ <code>col</code> zero-based indices.</p>
294
+
295
+
296
+
297
+
298
+ <div class="method-source-code" id="ref2ind-source">
299
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 89</span>
300
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref2ind</span>(<span class="ruby-identifier">str</span>)
301
+ <span class="ruby-keyword">return</span> [ <span class="ruby-value">-1</span>, <span class="ruby-value">-1</span> ] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">str</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^([A-Z]+)(\d+)$/</span>
302
+
303
+ <span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>
304
+ <span class="ruby-node">$1</span>.<span class="ruby-identifier">each_byte</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">chr</span><span class="ruby-operator">|</span> <span class="ruby-identifier">col</span> = <span class="ruby-identifier">col</span> <span class="ruby-operator">*</span> <span class="ruby-value">26</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">chr</span> <span class="ruby-operator">-</span> <span class="ruby-value">64</span>) }
305
+ [ <span class="ruby-node">$2</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>, <span class="ruby-identifier">col</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> ]
306
+ <span class="ruby-keyword">end</span></pre>
307
+ </div>
308
+
309
+ </div>
310
+
311
+
312
+
313
+
314
+ </div>
315
+
316
+
317
+ </section>
318
+
319
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
320
+ <header>
321
+ <h3>Public Instance Methods</h3>
322
+ </header>
323
+
324
+
325
+ <div id="method-i-3D-3D" class="method-detail ">
326
+
327
+ <div class="method-heading">
328
+ <span class="method-name">==</span><span
329
+ class="method-args">(other)</span>
330
+
331
+ <span class="method-click-advice">click to toggle source</span>
332
+
333
+ </div>
334
+
335
+
336
+ <div class="method-description">
337
+
338
+
339
+
340
+
341
+
342
+
343
+ <div class="method-source-code" id="3D-3D-source">
344
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 48</span>
345
+ <span class="ruby-keyword">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">other</span>)
346
+ <span class="ruby-operator">!</span><span class="ruby-identifier">other</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@row_range</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">row_range</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@col_range</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">col_range</span>)
347
+ <span class="ruby-keyword">end</span></pre>
348
+ </div>
349
+
350
+ </div>
351
+
352
+
353
+
354
+
355
+ </div>
356
+
357
+
358
+ <div id="method-i-cover-3F" class="method-detail ">
359
+
360
+ <div class="method-heading">
361
+ <span class="method-name">cover?</span><span
362
+ class="method-args">(other)</span>
363
+
364
+ <span class="method-click-advice">click to toggle source</span>
365
+
366
+ </div>
367
+
368
+
369
+ <div class="method-description">
370
+
371
+
372
+
373
+
374
+
375
+
376
+ <div class="method-source-code" id="cover-3F-source">
377
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 52</span>
378
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">cover?</span>(<span class="ruby-identifier">other</span>)
379
+ <span class="ruby-operator">!</span><span class="ruby-identifier">other</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">cover?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">begin</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">cover?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">end</span>) <span class="ruby-operator">&amp;&amp;</span>
380
+ <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">cover?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">begin</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">cover?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">end</span>))
381
+ <span class="ruby-keyword">end</span></pre>
382
+ </div>
383
+
384
+ </div>
385
+
386
+
387
+
388
+
389
+ </div>
390
+
391
+
392
+ <div id="method-i-first_col" class="method-detail ">
393
+
394
+ <div class="method-heading">
395
+ <span class="method-name">first_col</span><span
396
+ class="method-args">()</span>
397
+
398
+ <span class="method-click-advice">click to toggle source</span>
399
+
400
+ </div>
401
+
402
+
403
+ <div class="method-description">
404
+
405
+
406
+
407
+
408
+
409
+
410
+ <div class="method-source-code" id="first_col-source">
411
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 40</span>
412
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">first_col</span>
413
+ <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">begin</span>
414
+ <span class="ruby-keyword">end</span></pre>
415
+ </div>
416
+
417
+ </div>
418
+
419
+
420
+
421
+
422
+ </div>
423
+
424
+
425
+ <div id="method-i-first_row" class="method-detail ">
426
+
427
+ <div class="method-heading">
428
+ <span class="method-name">first_row</span><span
429
+ class="method-args">()</span>
430
+
431
+ <span class="method-click-advice">click to toggle source</span>
432
+
433
+ </div>
434
+
435
+
436
+ <div class="method-description">
437
+
438
+
439
+
440
+
441
+
442
+
443
+ <div class="method-source-code" id="first_row-source">
444
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 32</span>
445
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">first_row</span>
446
+ <span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">begin</span>
447
+ <span class="ruby-keyword">end</span></pre>
448
+ </div>
449
+
450
+ </div>
451
+
452
+
453
+
454
+
455
+ </div>
456
+
457
+
458
+ <div id="method-i-inspect" class="method-detail ">
459
+
460
+ <div class="method-heading">
461
+ <span class="method-name">inspect</span><span
462
+ class="method-args">()</span>
463
+
464
+ <span class="method-click-advice">click to toggle source</span>
465
+
466
+ </div>
467
+
468
+
469
+ <div class="method-description">
470
+
471
+
472
+
473
+
474
+
475
+
476
+ <div class="method-source-code" id="inspect-source">
477
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 65</span>
478
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">inspect</span>
479
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">single_cell?</span> <span class="ruby-keyword">then</span>
480
+ <span class="ruby-node">&quot;#&lt;#{self.class} @row=#{@row_range.begin} @col=#{@col_range.begin}&gt;&quot;</span>
481
+ <span class="ruby-keyword">else</span>
482
+ <span class="ruby-node">&quot;#&lt;#{self.class} @row_range=#{@row_range} @col_range=#{@col_range}&gt;&quot;</span>
483
+ <span class="ruby-keyword">end</span>
484
+ <span class="ruby-keyword">end</span></pre>
485
+ </div>
486
+
487
+ </div>
488
+
489
+
490
+
491
+
492
+ </div>
493
+
494
+
495
+ <div id="method-i-last_col" class="method-detail ">
496
+
497
+ <div class="method-heading">
498
+ <span class="method-name">last_col</span><span
499
+ class="method-args">()</span>
500
+
501
+ <span class="method-click-advice">click to toggle source</span>
502
+
503
+ </div>
504
+
505
+
506
+ <div class="method-description">
507
+
508
+
509
+
510
+
511
+
512
+
513
+ <div class="method-source-code" id="last_col-source">
514
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 44</span>
515
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">last_col</span>
516
+ <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">end</span>
517
+ <span class="ruby-keyword">end</span></pre>
518
+ </div>
519
+
520
+ </div>
521
+
522
+
523
+
524
+
525
+ </div>
526
+
527
+
528
+ <div id="method-i-last_row" class="method-detail ">
529
+
530
+ <div class="method-heading">
531
+ <span class="method-name">last_row</span><span
532
+ class="method-args">()</span>
533
+
534
+ <span class="method-click-advice">click to toggle source</span>
535
+
536
+ </div>
537
+
538
+
539
+ <div class="method-description">
540
+
541
+
542
+
543
+
544
+
545
+
546
+ <div class="method-source-code" id="last_row-source">
547
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 36</span>
548
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">last_row</span>
549
+ <span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">end</span>
550
+ <span class="ruby-keyword">end</span></pre>
551
+ </div>
552
+
553
+ </div>
554
+
555
+
556
+
557
+
558
+ </div>
559
+
560
+
561
+ <div id="method-i-single_cell-3F" class="method-detail ">
562
+
563
+ <div class="method-heading">
564
+ <span class="method-name">single_cell?</span><span
565
+ class="method-args">()</span>
566
+
567
+ <span class="method-click-advice">click to toggle source</span>
568
+
569
+ </div>
570
+
571
+
572
+ <div class="method-description">
573
+
574
+
575
+
576
+
577
+
578
+
579
+ <div class="method-source-code" id="single_cell-3F-source">
580
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 28</span>
581
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">single_cell?</span>
582
+ (<span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">begin</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">end</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">begin</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">end</span>)
583
+ <span class="ruby-keyword">end</span></pre>
584
+ </div>
585
+
586
+ </div>
587
+
588
+
589
+
590
+
591
+ </div>
592
+
593
+
594
+ <div id="method-i-to_s" class="method-detail ">
595
+
596
+ <div class="method-heading">
597
+ <span class="method-name">to_s</span><span
598
+ class="method-args">()</span>
599
+
600
+ <span class="method-click-advice">click to toggle source</span>
601
+
602
+ </div>
603
+
604
+
605
+ <div class="method-description">
606
+
607
+
608
+
609
+
610
+
611
+
612
+ <div class="method-source-code" id="to_s-source">
613
+ <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 57</span>
614
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
615
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">single_cell?</span> <span class="ruby-keyword">then</span>
616
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ind2ref</span>(<span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">begin</span>, <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">begin</span>)
617
+ <span class="ruby-keyword">else</span>
618
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ind2ref</span>(<span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">begin</span>, <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">begin</span>) <span class="ruby-operator">+</span> <span class="ruby-string">':'</span> <span class="ruby-operator">+</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ind2ref</span>(<span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">end</span>, <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">end</span>)
619
+ <span class="ruby-keyword">end</span>
620
+ <span class="ruby-keyword">end</span></pre>
621
+ </div>
622
+
623
+ </div>
624
+
625
+
626
+
627
+
628
+ </div>
629
+
630
+
631
+ </section>
632
+
633
+ </section>
634
+ </main>
635
+
636
+
637
+ <footer id="validator-badges" role="contentinfo">
638
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
639
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
640
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
641
+ </footer>
642
+