workbook 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.yardoc/checksums +18 -0
- data/.yardoc/object_types +3 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile.lock +1 -1
- data/{readme.markdown → README.md} +36 -10
- data/doc/RubyXL.html +128 -0
- data/doc/RubyXL/Cell.html +202 -0
- data/doc/RubyXL/Workbook.html +447 -0
- data/doc/Workbook.html +130 -0
- data/doc/Workbook/Book.html +1484 -0
- data/doc/Workbook/Cell.html +1402 -0
- data/doc/Workbook/Format.html +654 -0
- data/doc/Workbook/Modules.html +117 -0
- data/doc/Workbook/Modules/RawObjectsStorage.html +508 -0
- data/doc/Workbook/Modules/TableDiffSort.html +620 -0
- data/doc/Workbook/Modules/TypeParser.html +1012 -0
- data/doc/Workbook/Readers.html +117 -0
- data/doc/Workbook/Readers/CsvReader.html +262 -0
- data/doc/Workbook/Readers/TxtReader.html +238 -0
- data/doc/Workbook/Readers/XlsReader.html +362 -0
- data/doc/Workbook/Readers/XlsShared.html +189 -0
- data/doc/Workbook/Readers/XlsxReader.html +295 -0
- data/doc/Workbook/Row.html +1939 -0
- data/doc/Workbook/Sheet.html +528 -0
- data/doc/Workbook/Table.html +883 -0
- data/doc/Workbook/Template.html +639 -0
- data/doc/Workbook/Writers.html +117 -0
- data/doc/Workbook/Writers/CsvTableWriter.html +175 -0
- data/doc/Workbook/Writers/XlsWriter.html +865 -0
- data/doc/_index.html +336 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +236 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +236 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +972 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/workbook/book.rb +38 -29
- data/lib/workbook/cell.rb +25 -0
- data/lib/workbook/format.rb +9 -2
- data/lib/workbook/modules/raw_objects_storage.rb +5 -0
- data/lib/workbook/modules/table_diff_sort.rb +8 -6
- data/lib/workbook/modules/type_parser.rb +16 -3
- data/lib/workbook/readers/xls_reader.rb +1 -70
- data/lib/workbook/readers/xls_shared.rb +75 -0
- data/lib/workbook/row.rb +89 -17
- data/lib/workbook/sheet.rb +26 -0
- data/lib/workbook/table.rb +20 -1
- data/lib/workbook/template.rb +12 -11
- data/lib/workbook/writers/xls_writer.rb +19 -77
- data/test/test_modules_table_diff_sort.rb +19 -6
- data/test/test_row.rb +54 -0
- data/test/test_sheet.rb +8 -0
- data/test/test_table.rb +22 -3
- data/test/test_writers_xls_writer.rb +3 -0
- data/workbook.gemspec +1 -1
- metadata +46 -3
@@ -0,0 +1,117 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Workbook::Writers
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (W)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../Workbook.html" title="Workbook (module)">Workbook</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Writers</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Workbook::Writers
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/workbook/writers/xls_writer.rb<span class="defines">,<br />
|
83
|
+
lib/workbook/writers/csv_table_writer.rb</span>
|
84
|
+
</dd>
|
85
|
+
|
86
|
+
</dl>
|
87
|
+
<div class="clear"></div>
|
88
|
+
|
89
|
+
<h2>Defined Under Namespace</h2>
|
90
|
+
<p class="children">
|
91
|
+
|
92
|
+
|
93
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Writers/CsvTableWriter.html" title="Workbook::Writers::CsvTableWriter (module)">CsvTableWriter</a></span>, <span class='object_link'><a href="Writers/XlsWriter.html" title="Workbook::Writers::XlsWriter (module)">XlsWriter</a></span>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
</p>
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
|
110
|
+
<div id="footer">
|
111
|
+
Generated on Thu Jan 17 13:15:56 2013 by
|
112
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
113
|
+
0.8.3 (ruby-1.8.7).
|
114
|
+
</div>
|
115
|
+
|
116
|
+
</body>
|
117
|
+
</html>
|
@@ -0,0 +1,175 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Workbook::Writers::CsvTableWriter
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Workbook.html" title="Workbook (module)">Workbook</a></span></span> » <span class='title'><span class='object_link'><a href="../Writers.html" title="Workbook::Writers (module)">Writers</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">CsvTableWriter</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Workbook::Writers::CsvTableWriter
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
<dt class="r1">Included in:</dt>
|
81
|
+
<dd class="r1"><span class='object_link'><a href="../Table.html" title="Workbook::Table (class)">Table</a></span></dd>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<dt class="r2 last">Defined in:</dt>
|
86
|
+
<dd class="r2 last">lib/workbook/writers/csv_table_writer.rb</dd>
|
87
|
+
|
88
|
+
</dl>
|
89
|
+
<div class="clear"></div>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<h2>
|
100
|
+
Instance Method Summary
|
101
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
102
|
+
</h2>
|
103
|
+
|
104
|
+
<ul class="summary">
|
105
|
+
|
106
|
+
<li class="public ">
|
107
|
+
<span class="summary_signature">
|
108
|
+
|
109
|
+
<a href="#to_csv-instance_method" title="#to_csv (instance method)">- (Object) <strong>to_csv</strong>(options = {}) </a>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
</span>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
124
|
+
|
125
|
+
</li>
|
126
|
+
|
127
|
+
|
128
|
+
</ul>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<div id="instance_method_details" class="method_details_list">
|
134
|
+
<h2>Instance Method Details</h2>
|
135
|
+
|
136
|
+
|
137
|
+
<div class="method_details first">
|
138
|
+
<h3 class="signature first" id="to_csv-instance_method">
|
139
|
+
|
140
|
+
- (<tt>Object</tt>) <strong>to_csv</strong>(options = {})
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</h3><table class="source_code">
|
147
|
+
<tr>
|
148
|
+
<td>
|
149
|
+
<pre class="lines">
|
150
|
+
|
151
|
+
|
152
|
+
6</pre>
|
153
|
+
</td>
|
154
|
+
<td>
|
155
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/writers/csv_table_writer.rb', line 6</span>
|
156
|
+
|
157
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_to_csv identifier id'>to_csv</span> <span class='rubyid_options identifier id'>options</span><span class='assign token'>=</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span>
|
158
|
+
</pre>
|
159
|
+
</td>
|
160
|
+
</tr>
|
161
|
+
</table>
|
162
|
+
</div>
|
163
|
+
|
164
|
+
</div>
|
165
|
+
|
166
|
+
</div>
|
167
|
+
|
168
|
+
<div id="footer">
|
169
|
+
Generated on Thu Jan 17 13:15:59 2013 by
|
170
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
171
|
+
0.8.3 (ruby-1.8.7).
|
172
|
+
</div>
|
173
|
+
|
174
|
+
</body>
|
175
|
+
</html>
|
@@ -0,0 +1,865 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Workbook::Writers::XlsWriter
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (X)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Workbook.html" title="Workbook (module)">Workbook</a></span></span> » <span class='title'><span class='object_link'><a href="../Writers.html" title="Workbook::Writers (module)">Writers</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">XlsWriter</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Workbook::Writers::XlsWriter
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
<dt class="r1">Included in:</dt>
|
81
|
+
<dd class="r1"><span class='object_link'><a href="../Book.html" title="Workbook::Book (class)">Book</a></span></dd>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<dt class="r2 last">Defined in:</dt>
|
86
|
+
<dd class="r2 last">lib/workbook/writers/xls_writer.rb</dd>
|
87
|
+
|
88
|
+
</dl>
|
89
|
+
<div class="clear"></div>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<h2>
|
100
|
+
Instance Method Summary
|
101
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
102
|
+
</h2>
|
103
|
+
|
104
|
+
<ul class="summary">
|
105
|
+
|
106
|
+
<li class="public ">
|
107
|
+
<span class="summary_signature">
|
108
|
+
|
109
|
+
<a href="#format_to_xls_format-instance_method" title="#format_to_xls_format (instance method)">- (Spreadsheet::Format) <strong>format_to_xls_format</strong>(f) </a>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
</span>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<span class="summary_desc"><div class='inline'>
|
124
|
+
<p>Generates an Spreadsheet (from the spreadsheet gem) in order to build an
|
125
|
+
XlS.</p>
|
126
|
+
</div></span>
|
127
|
+
|
128
|
+
</li>
|
129
|
+
|
130
|
+
|
131
|
+
<li class="public ">
|
132
|
+
<span class="summary_signature">
|
133
|
+
|
134
|
+
<a href="#html_color_to_xls_color-instance_method" title="#html_color_to_xls_color (instance method)">- (String) <strong>html_color_to_xls_color</strong>(hex) </a>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
</span>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<span class="summary_desc"><div class='inline'>
|
149
|
+
<p>Attempt to convert html-hex color value to xls color number.</p>
|
150
|
+
</div></span>
|
151
|
+
|
152
|
+
</li>
|
153
|
+
|
154
|
+
|
155
|
+
<li class="public ">
|
156
|
+
<span class="summary_signature">
|
157
|
+
|
158
|
+
<a href="#init_spreadsheet_template-instance_method" title="#init_spreadsheet_template (instance method)">- (Object) <strong>init_spreadsheet_template</strong> </a>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
</span>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
173
|
+
|
174
|
+
</li>
|
175
|
+
|
176
|
+
|
177
|
+
<li class="public ">
|
178
|
+
<span class="summary_signature">
|
179
|
+
|
180
|
+
<a href="#strftime_to_ms_format-instance_method" title="#strftime_to_ms_format (instance method)">- (String<sup>?</sup>) <strong>strftime_to_ms_format</strong>(numberformat) </a>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
</span>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
<span class="summary_desc"><div class='inline'>
|
195
|
+
<p>Converts standard (ruby/C++/unix/…) strftime formatting to MS’s
|
196
|
+
formatting.</p>
|
197
|
+
</div></span>
|
198
|
+
|
199
|
+
</li>
|
200
|
+
|
201
|
+
|
202
|
+
<li class="public ">
|
203
|
+
<span class="summary_signature">
|
204
|
+
|
205
|
+
<a href="#to_xls-instance_method" title="#to_xls (instance method)">- (Spreadsheet) <strong>to_xls</strong>(options = {}) </a>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
</span>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
<span class="summary_desc"><div class='inline'>
|
220
|
+
<p>Generates an Spreadsheet (from the spreadsheet gem) in order to build an
|
221
|
+
XlS.</p>
|
222
|
+
</div></span>
|
223
|
+
|
224
|
+
</li>
|
225
|
+
|
226
|
+
|
227
|
+
<li class="public ">
|
228
|
+
<span class="summary_signature">
|
229
|
+
|
230
|
+
<a href="#write_to_xls-instance_method" title="#write_to_xls (instance method)">- (Object) <strong>write_to_xls</strong>(filename = "#{title}.xls", options = {}) </a>
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
</span>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
<span class="summary_desc"><div class='inline'>
|
245
|
+
<p>Write the current workbook to Microsoft Excel format (using the spreadsheet
|
246
|
+
gem).</p>
|
247
|
+
</div></span>
|
248
|
+
|
249
|
+
</li>
|
250
|
+
|
251
|
+
|
252
|
+
<li class="public ">
|
253
|
+
<span class="summary_signature">
|
254
|
+
|
255
|
+
<a href="#xls_sheet-instance_method" title="#xls_sheet (instance method)">- (Object) <strong>xls_sheet</strong>(a) </a>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
</span>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
270
|
+
|
271
|
+
</li>
|
272
|
+
|
273
|
+
|
274
|
+
<li class="public ">
|
275
|
+
<span class="summary_signature">
|
276
|
+
|
277
|
+
<a href="#xls_template-instance_method" title="#xls_template (instance method)">- (Object) <strong>xls_template</strong> </a>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
</span>
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
292
|
+
|
293
|
+
</li>
|
294
|
+
|
295
|
+
|
296
|
+
</ul>
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
<div id="instance_method_details" class="method_details_list">
|
302
|
+
<h2>Instance Method Details</h2>
|
303
|
+
|
304
|
+
|
305
|
+
<div class="method_details first">
|
306
|
+
<h3 class="signature first" id="format_to_xls_format-instance_method">
|
307
|
+
|
308
|
+
- (<tt>Spreadsheet::Format</tt>) <strong>format_to_xls_format</strong>(f)
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
</h3><div class="docstring">
|
315
|
+
<div class="discussion">
|
316
|
+
|
317
|
+
<p>Generates an Spreadsheet (from the spreadsheet gem) in order to build an
|
318
|
+
XlS</p>
|
319
|
+
|
320
|
+
|
321
|
+
</div>
|
322
|
+
</div>
|
323
|
+
<div class="tags">
|
324
|
+
<p class="tag_title">Parameters:</p>
|
325
|
+
<ul class="param">
|
326
|
+
|
327
|
+
<li>
|
328
|
+
|
329
|
+
<span class='name'>f</span>
|
330
|
+
|
331
|
+
|
332
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Format.html" title="Workbook::Format (class)">Workbook::Format</a></span></tt>, <tt>Hash</tt>)</span>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
—
|
337
|
+
<div class='inline'>
|
338
|
+
<p>A Workbook::Format or hash with format-options (:font_weight, :rotation,
|
339
|
+
:background_color, :number_format, :text_direction, :color, :font_family)</p>
|
340
|
+
</div>
|
341
|
+
|
342
|
+
</li>
|
343
|
+
|
344
|
+
</ul>
|
345
|
+
|
346
|
+
<p class="tag_title">Returns:</p>
|
347
|
+
<ul class="return">
|
348
|
+
|
349
|
+
<li>
|
350
|
+
|
351
|
+
|
352
|
+
<span class='type'>(<tt>Spreadsheet::Format</tt>)</span>
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
—
|
357
|
+
<div class='inline'>
|
358
|
+
<p>A Spreadsheet format-object, ready for writing or more lower level
|
359
|
+
operations</p>
|
360
|
+
</div>
|
361
|
+
|
362
|
+
</li>
|
363
|
+
|
364
|
+
</ul>
|
365
|
+
|
366
|
+
</div><table class="source_code">
|
367
|
+
<tr>
|
368
|
+
<td>
|
369
|
+
<pre class="lines">
|
370
|
+
|
371
|
+
|
372
|
+
37
|
373
|
+
38
|
374
|
+
39
|
375
|
+
40
|
376
|
+
41
|
377
|
+
42
|
378
|
+
43
|
379
|
+
44
|
380
|
+
45
|
381
|
+
46
|
382
|
+
47
|
383
|
+
48
|
384
|
+
49
|
385
|
+
50
|
386
|
+
51
|
387
|
+
52
|
388
|
+
53
|
389
|
+
54
|
390
|
+
55
|
391
|
+
56</pre>
|
392
|
+
</td>
|
393
|
+
<td>
|
394
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/writers/xls_writer.rb', line 37</span>
|
395
|
+
|
396
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_format_to_xls_format identifier id'>format_to_xls_format</span> <span class='rubyid_f identifier id'>f</span>
|
397
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span>
|
398
|
+
<span class='rubyid_unless unless kw'>unless</span> <span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span> <span class='rubyid_Workbook constant id'>Workbook</span><span class='colon2 op'>::</span><span class='rubyid_Format constant id'>Format</span>
|
399
|
+
<span class='rubyid_f identifier id'>f</span> <span class='assign token'>=</span> <span class='rubyid_Workbook constant id'>Workbook</span><span class='colon2 op'>::</span><span class='rubyid_Format constant id'>Format</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span> <span class='rubyid_f identifier id'>f</span>
|
400
|
+
<span class='rubyid_end end kw'>end</span>
|
401
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span> <span class='assign token'>=</span> <span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_return_raw_for identifier id'>return_raw_for</span> <span class='rubyid_Spreadsheet constant id'>Spreadsheet</span><span class='colon2 op'>::</span><span class='rubyid_Format constant id'>Format</span>
|
402
|
+
<span class='rubyid_unless unless kw'>unless</span> <span class='rubyid_xlsfmt identifier id'>xlsfmt</span>
|
403
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span><span class='assign token'>=</span><span class='rubyid_Spreadsheet constant id'>Spreadsheet</span><span class='colon2 op'>::</span><span class='rubyid_Format constant id'>Format</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span> <span class='symbol val'>:weight=</span><span class='gt op'>></span><span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:font_weight</span><span class='rbrack token'>]</span>
|
404
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span><span class='dot token'>.</span><span class='rubyid_rotation identifier id'>rotation</span> <span class='assign token'>=</span> <span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:rotation</span><span class='rbrack token'>]</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:rotation</span><span class='rbrack token'>]</span>
|
405
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span><span class='dot token'>.</span><span class='rubyid_pattern_fg_color identifier id'>pattern_fg_color</span> <span class='assign token'>=</span> <span class='rubyid_html_color_to_xls_color identifier id'>html_color_to_xls_color</span><span class='lparen token'>(</span><span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:background_color</span><span class='rbrack token'>]</span><span class='rparen token'>)</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_html_color_to_xls_color identifier id'>html_color_to_xls_color</span><span class='lparen token'>(</span><span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:background_color</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
|
406
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span><span class='dot token'>.</span><span class='rubyid_pattern identifier id'>pattern</span> <span class='assign token'>=</span> <span class='integer val'>1</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_html_color_to_xls_color identifier id'>html_color_to_xls_color</span><span class='lparen token'>(</span><span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:background_color</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
|
407
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span><span class='dot token'>.</span><span class='rubyid_number_format identifier id'>number_format</span> <span class='assign token'>=</span> <span class='rubyid_strftime_to_ms_format identifier id'>strftime_to_ms_format</span><span class='lparen token'>(</span><span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:number_format</span><span class='rbrack token'>]</span><span class='rparen token'>)</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:number_format</span><span class='rbrack token'>]</span>
|
408
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span><span class='dot token'>.</span><span class='rubyid_text_direction identifier id'>text_direction</span> <span class='assign token'>=</span> <span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:text_direction</span><span class='rbrack token'>]</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:text_direction</span><span class='rbrack token'>]</span>
|
409
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span><span class='dot token'>.</span><span class='rubyid_font identifier id'>font</span><span class='dot token'>.</span><span class='rubyid_name identifier id'>name</span> <span class='assign token'>=</span> <span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:font_family</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_split identifier id'>split</span><span class='dot token'>.</span><span class='rubyid_first identifier id'>first</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:font_family</span><span class='rbrack token'>]</span>
|
410
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span><span class='dot token'>.</span><span class='rubyid_font identifier id'>font</span><span class='dot token'>.</span><span class='rubyid_family identifier id'>family</span> <span class='assign token'>=</span> <span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:font_family</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_split identifier id'>split</span><span class='dot token'>.</span><span class='rubyid_last identifier id'>last</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:font_family</span><span class='rbrack token'>]</span>
|
411
|
+
<span class='rubyid_xlsfmt identifier id'>xlsfmt</span><span class='dot token'>.</span><span class='rubyid_font identifier id'>font</span><span class='dot token'>.</span><span class='rubyid_color identifier id'>color</span> <span class='assign token'>=</span> <span class='rubyid_html_color_to_xls_color identifier id'>html_color_to_xls_color</span><span class='lparen token'>(</span><span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:color</span><span class='rbrack token'>]</span><span class='rparen token'>)</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_f identifier id'>f</span><span class='lbrack token'>[</span><span class='symbol val'>:color</span><span class='rbrack token'>]</span>
|
412
|
+
<span class='rubyid_f identifier id'>f</span><span class='dot token'>.</span><span class='rubyid_add_raw identifier id'>add_raw</span> <span class='rubyid_xlsfmt identifier id'>xlsfmt</span>
|
413
|
+
<span class='rubyid_end end kw'>end</span>
|
414
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_xlsfmt identifier id'>xlsfmt</span>
|
415
|
+
<span class='rubyid_end end kw'>end</span>
|
416
|
+
</pre>
|
417
|
+
</td>
|
418
|
+
</tr>
|
419
|
+
</table>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
<div class="method_details ">
|
423
|
+
<h3 class="signature " id="html_color_to_xls_color-instance_method">
|
424
|
+
|
425
|
+
- (<tt>String</tt>) <strong>html_color_to_xls_color</strong>(hex)
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
</h3><div class="docstring">
|
432
|
+
<div class="discussion">
|
433
|
+
|
434
|
+
<p>Attempt to convert html-hex color value to xls color number</p>
|
435
|
+
|
436
|
+
|
437
|
+
</div>
|
438
|
+
</div>
|
439
|
+
<div class="tags">
|
440
|
+
<p class="tag_title">Parameters:</p>
|
441
|
+
<ul class="param">
|
442
|
+
|
443
|
+
<li>
|
444
|
+
|
445
|
+
<span class='name'>hex</span>
|
446
|
+
|
447
|
+
|
448
|
+
<span class='type'>(<tt>String</tt>)</span>
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
—
|
453
|
+
<div class='inline'>
|
454
|
+
<p>color</p>
|
455
|
+
</div>
|
456
|
+
|
457
|
+
</li>
|
458
|
+
|
459
|
+
</ul>
|
460
|
+
|
461
|
+
<p class="tag_title">Returns:</p>
|
462
|
+
<ul class="return">
|
463
|
+
|
464
|
+
<li>
|
465
|
+
|
466
|
+
|
467
|
+
<span class='type'>(<tt>String</tt>)</span>
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
—
|
472
|
+
<div class='inline'>
|
473
|
+
<p>xls color</p>
|
474
|
+
</div>
|
475
|
+
|
476
|
+
</li>
|
477
|
+
|
478
|
+
</ul>
|
479
|
+
|
480
|
+
</div><table class="source_code">
|
481
|
+
<tr>
|
482
|
+
<td>
|
483
|
+
<pre class="lines">
|
484
|
+
|
485
|
+
|
486
|
+
62
|
487
|
+
63
|
488
|
+
64
|
489
|
+
65
|
490
|
+
66
|
491
|
+
67</pre>
|
492
|
+
</td>
|
493
|
+
<td>
|
494
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/writers/xls_writer.rb', line 62</span>
|
495
|
+
|
496
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_html_color_to_xls_color identifier id'>html_color_to_xls_color</span> <span class='rubyid_hex identifier id'>hex</span>
|
497
|
+
<span class='rubyid_Workbook constant id'>Workbook</span><span class='colon2 op'>::</span><span class='rubyid_Readers constant id'>Readers</span><span class='colon2 op'>::</span><span class='rubyid_XlsShared constant id'>XlsShared</span><span class='colon2 op'>::</span><span class='rubyid_XLS_COLORS constant id'>XLS_COLORS</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_k identifier id'>k</span><span class='comma token'>,</span><span class='rubyid_v identifier id'>v</span><span class='bitor op'>|</span>
|
498
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_k identifier id'>k</span> <span class='rubyid_if if_mod kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_v identifier id'>v</span> <span class='eq op'>==</span> <span class='rubyid_hex identifier id'>hex</span> <span class='rubyid_or or kw'>or</span> <span class='lparen token'>(</span><span class='rubyid_hex identifier id'>hex</span> <span class='rubyid_and and kw'>and</span> <span class='rubyid_hex identifier id'>hex</span> <span class='neq op'>!=</span> <span class='string val'>""</span> <span class='rubyid_and and kw'>and</span> <span class='rubyid_k identifier id'>k</span> <span class='eq op'>==</span> <span class='rubyid_hex identifier id'>hex</span><span class='dot token'>.</span><span class='rubyid_to_sym identifier id'>to_sym</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
499
|
+
<span class='rubyid_end end kw'>end</span>
|
500
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_nil nil kw'>nil</span>
|
501
|
+
<span class='rubyid_end end kw'>end</span>
|
502
|
+
</pre>
|
503
|
+
</td>
|
504
|
+
</tr>
|
505
|
+
</table>
|
506
|
+
</div>
|
507
|
+
|
508
|
+
<div class="method_details ">
|
509
|
+
<h3 class="signature " id="init_spreadsheet_template-instance_method">
|
510
|
+
|
511
|
+
- (<tt>Object</tt>) <strong>init_spreadsheet_template</strong>
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
</h3><table class="source_code">
|
518
|
+
<tr>
|
519
|
+
<td>
|
520
|
+
<pre class="lines">
|
521
|
+
|
522
|
+
|
523
|
+
101
|
524
|
+
102
|
525
|
+
103
|
526
|
+
104
|
527
|
+
105
|
528
|
+
106
|
529
|
+
107
|
530
|
+
108
|
531
|
+
109</pre>
|
532
|
+
</td>
|
533
|
+
<td>
|
534
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/writers/xls_writer.rb', line 101</span>
|
535
|
+
|
536
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_init_spreadsheet_template identifier id'>init_spreadsheet_template</span>
|
537
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_xls_template identifier id'>xls_template</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span> <span class='rubyid_Spreadsheet constant id'>Spreadsheet</span><span class='colon2 op'>::</span><span class='rubyid_Workbook constant id'>Workbook</span>
|
538
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_xls_template identifier id'>xls_template</span>
|
539
|
+
<span class='rubyid_else else kw'>else</span>
|
540
|
+
<span class='rubyid_t identifier id'>t</span> <span class='assign token'>=</span> <span class='rubyid_Spreadsheet constant id'>Spreadsheet</span><span class='colon2 op'>::</span><span class='rubyid_Workbook constant id'>Workbook</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span>
|
541
|
+
<span class='rubyid_template identifier id'>template</span><span class='dot token'>.</span><span class='rubyid_add_raw identifier id'>add_raw</span> <span class='rubyid_t identifier id'>t</span>
|
542
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_t identifier id'>t</span>
|
543
|
+
<span class='rubyid_end end kw'>end</span>
|
544
|
+
<span class='rubyid_end end kw'>end</span>
|
545
|
+
</pre>
|
546
|
+
</td>
|
547
|
+
</tr>
|
548
|
+
</table>
|
549
|
+
</div>
|
550
|
+
|
551
|
+
<div class="method_details ">
|
552
|
+
<h3 class="signature " id="strftime_to_ms_format-instance_method">
|
553
|
+
|
554
|
+
- (<tt>String</tt><sup>?</sup>) <strong>strftime_to_ms_format</strong>(numberformat)
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
</h3><div class="docstring">
|
561
|
+
<div class="discussion">
|
562
|
+
|
563
|
+
<p>Converts standard (ruby/C++/unix/…) strftime formatting to MS’s
|
564
|
+
formatting</p>
|
565
|
+
|
566
|
+
|
567
|
+
</div>
|
568
|
+
</div>
|
569
|
+
<div class="tags">
|
570
|
+
<p class="tag_title">Parameters:</p>
|
571
|
+
<ul class="param">
|
572
|
+
|
573
|
+
<li>
|
574
|
+
|
575
|
+
<span class='name'>numberformat</span>
|
576
|
+
|
577
|
+
|
578
|
+
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
—
|
583
|
+
<div class='inline'>
|
584
|
+
<p>(nil returns nil)</p>
|
585
|
+
</div>
|
586
|
+
|
587
|
+
</li>
|
588
|
+
|
589
|
+
</ul>
|
590
|
+
|
591
|
+
<p class="tag_title">Returns:</p>
|
592
|
+
<ul class="return">
|
593
|
+
|
594
|
+
<li>
|
595
|
+
|
596
|
+
|
597
|
+
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
</li>
|
602
|
+
|
603
|
+
</ul>
|
604
|
+
|
605
|
+
</div><table class="source_code">
|
606
|
+
<tr>
|
607
|
+
<td>
|
608
|
+
<pre class="lines">
|
609
|
+
|
610
|
+
|
611
|
+
73
|
612
|
+
74
|
613
|
+
75
|
614
|
+
76</pre>
|
615
|
+
</td>
|
616
|
+
<td>
|
617
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/writers/xls_writer.rb', line 73</span>
|
618
|
+
|
619
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_strftime_to_ms_format identifier id'>strftime_to_ms_format</span> <span class='rubyid_numberformat identifier id'>numberformat</span>
|
620
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_nil nil kw'>nil</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_numberformat identifier id'>numberformat</span><span class='dot token'>.</span><span class='rubyid_nil? fid id'>nil?</span>
|
621
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_numberformat identifier id'>numberformat</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%Y'</span><span class='comma token'>,</span><span class='string val'>'yyyy'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%A'</span><span class='comma token'>,</span><span class='string val'>'dddd'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%B'</span><span class='comma token'>,</span><span class='string val'>'mmmm'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%a'</span><span class='comma token'>,</span><span class='string val'>'ddd'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%b'</span><span class='comma token'>,</span><span class='string val'>'mmm'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%y'</span><span class='comma token'>,</span><span class='string val'>'yy'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%d'</span><span class='comma token'>,</span><span class='string val'>'dd'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%m'</span><span class='comma token'>,</span><span class='string val'>'mm'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%y'</span><span class='comma token'>,</span><span class='string val'>'y'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%y'</span><span class='comma token'>,</span><span class='string val'>'%%y'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='string val'>'%e'</span><span class='comma token'>,</span><span class='string val'>'d'</span><span class='rparen token'>)</span>
|
622
|
+
<span class='rubyid_end end kw'>end</span>
|
623
|
+
</pre>
|
624
|
+
</td>
|
625
|
+
</tr>
|
626
|
+
</table>
|
627
|
+
</div>
|
628
|
+
|
629
|
+
<div class="method_details ">
|
630
|
+
<h3 class="signature " id="to_xls-instance_method">
|
631
|
+
|
632
|
+
- (<tt>Spreadsheet</tt>) <strong>to_xls</strong>(options = {})
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
</h3><div class="docstring">
|
639
|
+
<div class="discussion">
|
640
|
+
|
641
|
+
<p>Generates an Spreadsheet (from the spreadsheet gem) in order to build an
|
642
|
+
XlS</p>
|
643
|
+
|
644
|
+
|
645
|
+
</div>
|
646
|
+
</div>
|
647
|
+
<div class="tags">
|
648
|
+
<p class="tag_title">Parameters:</p>
|
649
|
+
<ul class="param">
|
650
|
+
|
651
|
+
<li>
|
652
|
+
|
653
|
+
<span class='name'>options</span>
|
654
|
+
|
655
|
+
|
656
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
657
|
+
|
658
|
+
|
659
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
660
|
+
|
661
|
+
|
662
|
+
—
|
663
|
+
<div class='inline'>
|
664
|
+
<p>A hash with options (unused so far)</p>
|
665
|
+
</div>
|
666
|
+
|
667
|
+
</li>
|
668
|
+
|
669
|
+
</ul>
|
670
|
+
|
671
|
+
<p class="tag_title">Returns:</p>
|
672
|
+
<ul class="return">
|
673
|
+
|
674
|
+
<li>
|
675
|
+
|
676
|
+
|
677
|
+
<span class='type'>(<tt>Spreadsheet</tt>)</span>
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
—
|
682
|
+
<div class='inline'>
|
683
|
+
<p>A Spreadsheet object, ready for writing or more lower level operations</p>
|
684
|
+
</div>
|
685
|
+
|
686
|
+
</li>
|
687
|
+
|
688
|
+
</ul>
|
689
|
+
|
690
|
+
</div><table class="source_code">
|
691
|
+
<tr>
|
692
|
+
<td>
|
693
|
+
<pre class="lines">
|
694
|
+
|
695
|
+
|
696
|
+
11</pre>
|
697
|
+
</td>
|
698
|
+
<td>
|
699
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/writers/xls_writer.rb', line 11</span>
|
700
|
+
|
701
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_to_xls identifier id'>to_xls</span> <span class='rubyid_options identifier id'>options</span><span class='assign token'>=</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span>
|
702
|
+
</pre>
|
703
|
+
</td>
|
704
|
+
</tr>
|
705
|
+
</table>
|
706
|
+
</div>
|
707
|
+
|
708
|
+
<div class="method_details ">
|
709
|
+
<h3 class="signature " id="write_to_xls-instance_method">
|
710
|
+
|
711
|
+
- (<tt>Object</tt>) <strong>write_to_xls</strong>(filename = "#{title}.xls", options = {})
|
712
|
+
|
713
|
+
|
714
|
+
|
715
|
+
|
716
|
+
|
717
|
+
</h3><div class="docstring">
|
718
|
+
<div class="discussion">
|
719
|
+
|
720
|
+
<p>Write the current workbook to Microsoft Excel format (using the spreadsheet
|
721
|
+
gem)</p>
|
722
|
+
|
723
|
+
|
724
|
+
</div>
|
725
|
+
</div>
|
726
|
+
<div class="tags">
|
727
|
+
<p class="tag_title">Parameters:</p>
|
728
|
+
<ul class="param">
|
729
|
+
|
730
|
+
<li>
|
731
|
+
|
732
|
+
<span class='name'>filename</span>
|
733
|
+
|
734
|
+
|
735
|
+
<span class='type'>(<tt>String</tt>)</span>
|
736
|
+
|
737
|
+
|
738
|
+
<em class="default">(defaults to: <tt>"#{title}.xls"</tt>)</em>
|
739
|
+
|
740
|
+
|
741
|
+
</li>
|
742
|
+
|
743
|
+
<li>
|
744
|
+
|
745
|
+
<span class='name'>options</span>
|
746
|
+
|
747
|
+
|
748
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
749
|
+
|
750
|
+
|
751
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
752
|
+
|
753
|
+
|
754
|
+
—
|
755
|
+
<div class='inline'>
|
756
|
+
<p>see #to_xls</p>
|
757
|
+
</div>
|
758
|
+
|
759
|
+
</li>
|
760
|
+
|
761
|
+
</ul>
|
762
|
+
|
763
|
+
|
764
|
+
</div><table class="source_code">
|
765
|
+
<tr>
|
766
|
+
<td>
|
767
|
+
<pre class="lines">
|
768
|
+
|
769
|
+
|
770
|
+
82</pre>
|
771
|
+
</td>
|
772
|
+
<td>
|
773
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/writers/xls_writer.rb', line 82</span>
|
774
|
+
|
775
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_write_to_xls identifier id'>write_to_xls</span> <span class='rubyid_filename identifier id'>filename</span><span class='assign token'>=</span><span class='dstring node'>"#{title}.xls"</span><span class='comma token'>,</span> <span class='rubyid_options identifier id'>options</span><span class='assign token'>=</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span>
|
776
|
+
</pre>
|
777
|
+
</td>
|
778
|
+
</tr>
|
779
|
+
</table>
|
780
|
+
</div>
|
781
|
+
|
782
|
+
<div class="method_details ">
|
783
|
+
<h3 class="signature " id="xls_sheet-instance_method">
|
784
|
+
|
785
|
+
- (<tt>Object</tt>) <strong>xls_sheet</strong>(a)
|
786
|
+
|
787
|
+
|
788
|
+
|
789
|
+
|
790
|
+
|
791
|
+
</h3><table class="source_code">
|
792
|
+
<tr>
|
793
|
+
<td>
|
794
|
+
<pre class="lines">
|
795
|
+
|
796
|
+
|
797
|
+
88
|
798
|
+
89
|
799
|
+
90
|
800
|
+
91
|
801
|
+
92
|
802
|
+
93
|
803
|
+
94
|
804
|
+
95</pre>
|
805
|
+
</td>
|
806
|
+
<td>
|
807
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/writers/xls_writer.rb', line 88</span>
|
808
|
+
|
809
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_xls_sheet identifier id'>xls_sheet</span> <span class='rubyid_a identifier id'>a</span>
|
810
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_xls_template identifier id'>xls_template</span><span class='dot token'>.</span><span class='rubyid_worksheet identifier id'>worksheet</span><span class='lparen token'>(</span><span class='rubyid_a identifier id'>a</span><span class='rparen token'>)</span>
|
811
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_xls_template identifier id'>xls_template</span><span class='dot token'>.</span><span class='rubyid_worksheet identifier id'>worksheet</span><span class='lparen token'>(</span><span class='rubyid_a identifier id'>a</span><span class='rparen token'>)</span>
|
812
|
+
<span class='rubyid_else else kw'>else</span>
|
813
|
+
<span class='rubyid_xls_template identifier id'>xls_template</span><span class='dot token'>.</span><span class='rubyid_create_worksheet identifier id'>create_worksheet</span>
|
814
|
+
<span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_xls_sheet identifier id'>xls_sheet</span> <span class='rubyid_a identifier id'>a</span>
|
815
|
+
<span class='rubyid_end end kw'>end</span>
|
816
|
+
<span class='rubyid_end end kw'>end</span>
|
817
|
+
</pre>
|
818
|
+
</td>
|
819
|
+
</tr>
|
820
|
+
</table>
|
821
|
+
</div>
|
822
|
+
|
823
|
+
<div class="method_details ">
|
824
|
+
<h3 class="signature " id="xls_template-instance_method">
|
825
|
+
|
826
|
+
- (<tt>Object</tt>) <strong>xls_template</strong>
|
827
|
+
|
828
|
+
|
829
|
+
|
830
|
+
|
831
|
+
|
832
|
+
</h3><table class="source_code">
|
833
|
+
<tr>
|
834
|
+
<td>
|
835
|
+
<pre class="lines">
|
836
|
+
|
837
|
+
|
838
|
+
97
|
839
|
+
98
|
840
|
+
99</pre>
|
841
|
+
</td>
|
842
|
+
<td>
|
843
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/writers/xls_writer.rb', line 97</span>
|
844
|
+
|
845
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_xls_template identifier id'>xls_template</span>
|
846
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_template identifier id'>template</span><span class='dot token'>.</span><span class='rubyid_raws identifier id'>raws</span><span class='lbrack token'>[</span><span class='rubyid_Spreadsheet constant id'>Spreadsheet</span><span class='colon2 op'>::</span><span class='rubyid_Excel constant id'>Excel</span><span class='colon2 op'>::</span><span class='rubyid_Workbook constant id'>Workbook</span><span class='rbrack token'>]</span> <span class='question op'>?</span> <span class='rubyid_template identifier id'>template</span><span class='dot token'>.</span><span class='rubyid_raws identifier id'>raws</span><span class='lbrack token'>[</span><span class='rubyid_Spreadsheet constant id'>Spreadsheet</span><span class='colon2 op'>::</span><span class='rubyid_Excel constant id'>Excel</span><span class='colon2 op'>::</span><span class='rubyid_Workbook constant id'>Workbook</span><span class='rbrack token'>]</span> <span class='colon op'>:</span> <span class='rubyid_template identifier id'>template</span><span class='dot token'>.</span><span class='rubyid_raws identifier id'>raws</span><span class='lbrack token'>[</span><span class='rubyid_Spreadsheet constant id'>Spreadsheet</span><span class='colon2 op'>::</span><span class='rubyid_Workbook constant id'>Workbook</span><span class='rbrack token'>]</span>
|
847
|
+
<span class='rubyid_end end kw'>end</span>
|
848
|
+
</pre>
|
849
|
+
</td>
|
850
|
+
</tr>
|
851
|
+
</table>
|
852
|
+
</div>
|
853
|
+
|
854
|
+
</div>
|
855
|
+
|
856
|
+
</div>
|
857
|
+
|
858
|
+
<div id="footer">
|
859
|
+
Generated on Thu Jan 17 13:15:57 2013 by
|
860
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
861
|
+
0.8.3 (ruby-1.8.7).
|
862
|
+
</div>
|
863
|
+
|
864
|
+
</body>
|
865
|
+
</html>
|