acts_as_xlsx 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,372 +0,0 @@
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: Axlsx::Ar::SingletonMethods
8
-
9
- &mdash; acts_as_xlsx: a rails plug in for axlsx
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
- relpath = '../..';
19
- if (relpath != '') relpath += '/';
20
- </script>
21
-
22
- <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
23
-
24
- <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
25
-
26
-
27
- </head>
28
- <body>
29
- <script type="text/javascript" charset="utf-8">
30
- if (window.top.frames.main) document.body.className = 'frames';
31
- </script>
32
-
33
- <div id="header">
34
- <div id="menu">
35
-
36
- <a href="../../_index.html">Index (S)</a> &raquo;
37
- <span class='title'><span class='object_link'><a href="../../Axlsx.html" title="Axlsx (module)">Axlsx</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Ar.html" title="Axlsx::Ar (module)">Ar</a></span></span>
38
- &raquo;
39
- <span class="title">SingletonMethods</span>
40
-
41
-
42
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
- </div>
44
-
45
- <div id="search">
46
-
47
- <a id="class_list_link" href="#">Class List</a>
48
-
49
- <a id="method_list_link" href="#">Method List</a>
50
-
51
- <a id="file_list_link" href="#">File List</a>
52
-
53
- </div>
54
- <div class="clear"></div>
55
- </div>
56
-
57
- <iframe id="search_frame"></iframe>
58
-
59
- <div id="content"><h1>Module: Axlsx::Ar::SingletonMethods
60
-
61
-
62
-
63
- </h1>
64
-
65
- <dl class="box">
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
- <dt class="r1 last">Defined in:</dt>
75
- <dd class="r1 last">lib/acts_as_xlsx/ar.rb</dd>
76
-
77
- </dl>
78
- <div class="clear"></div>
79
-
80
- <h2>Overview</h2><div class="docstring">
81
- <div class="discussion">
82
- <p>
83
- Singleton methods for the mixin
84
- </p>
85
-
86
-
87
- </div>
88
- </div>
89
- <div class="tags">
90
-
91
-
92
- </div>
93
-
94
-
95
-
96
-
97
-
98
- <h2>
99
- Instance Method Summary
100
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
101
- </h2>
102
-
103
- <ul class="summary">
104
-
105
- <li class="public ">
106
- <span class="summary_signature">
107
-
108
- <a href="#to_xlsx-instance_method" title="#to_xlsx (instance method)">- (Object) <strong>to_xlsx</strong>(options = {}) </a>
109
-
110
-
111
-
112
- </span>
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
- <span class="summary_desc"><div class='inline'><p>
122
- Maps the AR class to an Axlsx package options are passed into AR find.
123
- </p>
124
- </div></span>
125
-
126
- </li>
127
-
128
-
129
- </ul>
130
-
131
-
132
-
133
-
134
- <div id="instance_method_details" class="method_details_list">
135
- <h2>Instance Method Details</h2>
136
-
137
-
138
- <div class="method_details first">
139
- <p class="signature first" id="to_xlsx-instance_method">
140
-
141
- - (<tt>Object</tt>) <strong>to_xlsx</strong>(options = {})
142
-
143
-
144
-
145
- </p><div class="docstring">
146
- <div class="discussion">
147
- <p>
148
- Maps the AR class to an Axlsx package options are passed into AR find
149
- </p>
150
-
151
-
152
- </div>
153
- </div>
154
- <div class="tags">
155
- <h3>Parameters:</h3>
156
- <ul class="param">
157
-
158
- <li>
159
-
160
- <span class='name'>columns</span>
161
-
162
-
163
- <span class='type'>(<tt>Array</tt>, <tt>Array</tt>)</span>
164
-
165
-
166
-
167
- &mdash;
168
- <div class='inline'><p>
169
- as an array of symbols or a symbol that defines the attributes or methods
170
- to render in the sheet.
171
- </p>
172
- </div>
173
-
174
- </li>
175
-
176
- <li>
177
-
178
- <span class='name'>options</span>
179
-
180
-
181
- <span class='type'>(<tt>Hash</tt>)</span>
182
-
183
-
184
- <em class="default">(defaults to: <tt>{}</tt>)</em>
185
-
186
-
187
- &mdash;
188
- <div class='inline'><p>
189
- a customizable set of options
190
- </p>
191
- </div>
192
-
193
- </li>
194
-
195
- </ul>
196
-
197
-
198
-
199
-
200
- <h3>Options Hash (<tt>options</tt>):</h3>
201
- <ul class="option">
202
-
203
- <li>
204
- <span class="name">header_style</span>
205
- <span class="type">(<tt>Integer</tt>)</span>
206
- <span class="default">
207
-
208
- </span>
209
- &mdash; <div class='inline'><p>
210
- to apply to the first row of field names
211
- </p>
212
- </div>
213
- </li>
214
-
215
- <li>
216
- <span class="name">types</span>
217
- <span class="type">(<tt>Array</tt>, <tt>Symbol</tt>)</span>
218
- <span class="default">
219
-
220
- </span>
221
- &mdash; <div class='inline'><p>
222
- an array of Axlsx types for each cell in data rows or a single type that
223
- will be applied to all types.
224
- </p>
225
- </div>
226
- </li>
227
-
228
- <li>
229
- <span class="name">style</span>
230
- <span class="type">(<tt>Integer</tt>, <tt>Array</tt>)</span>
231
- <span class="default">
232
-
233
- </span>
234
- &mdash; <div class='inline'><p>
235
- The style to pass to Worksheet#add_row
236
- </p>
237
- </div>
238
- </li>
239
-
240
- <li>
241
- <span class="name">i18n</span>
242
- <span class="type">(<tt>String</tt>)</span>
243
- <span class="default">
244
-
245
- </span>
246
- &mdash; <div class='inline'><p>
247
- The path to i18n attributes. (usually activerecord.attributes)
248
- </p>
249
- </div>
250
- </li>
251
-
252
- </ul>
253
-
254
-
255
-
256
- <h3>See Also:</h3>
257
- <ul class="see">
258
-
259
- <li>Worksheet#add_row</li>
260
-
261
- </ul>
262
-
263
- </div><table class="source_code">
264
- <tr>
265
- <td>
266
- <pre class="lines">
267
-
268
-
269
- 47
270
- 48
271
- 49
272
- 50
273
- 51
274
- 52
275
- 53
276
- 54
277
- 55
278
- 56
279
- 57
280
- 58
281
- 59
282
- 60
283
- 61
284
- 62
285
- 63
286
- 64
287
- 65
288
- 66
289
- 67
290
- 68
291
- 69
292
- 70
293
- 71
294
- 72
295
- 73
296
- 74
297
- 75
298
- 76
299
- 77
300
- 78
301
- 79
302
- 80
303
- 81
304
- 82
305
- 83
306
- 84
307
- 85
308
- 86
309
- 87</pre>
310
- </td>
311
- <td>
312
- <pre class="code"><span class="info file"># File 'lib/acts_as_xlsx/ar.rb', line 47</span>
313
-
314
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_to_xlsx identifier id'>to_xlsx</span><span class='lparen 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><span class='rparen token'>)</span>
315
-
316
- <span class='rubyid_row_style identifier id'>row_style</span> <span class='assign token'>=</span> <span class='rubyid_options identifier id'>options</span><span class='dot token'>.</span><span class='rubyid_delete identifier id'>delete</span><span class='lparen token'>(</span><span class='symbol val'>:style</span><span class='rparen token'>)</span>
317
- <span class='rubyid_header_style identifier id'>header_style</span> <span class='assign token'>=</span> <span class='rubyid_options identifier id'>options</span><span class='dot token'>.</span><span class='rubyid_delete identifier id'>delete</span><span class='lparen token'>(</span><span class='symbol val'>:header_style</span><span class='rparen token'>)</span> <span class='orop op'>||</span> <span class='rubyid_row_style identifier id'>row_style</span>
318
- <span class='rubyid_types identifier id'>types</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rubyid_options identifier id'>options</span><span class='dot token'>.</span><span class='rubyid_delete identifier id'>delete</span><span class='lparen token'>(</span><span class='symbol val'>:types</span><span class='rparen token'>)</span> <span class='orop op'>||</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_flatten identifier id'>flatten</span>
319
-
320
- <span class='rubyid_i18n identifier id'>i18n</span> <span class='assign token'>=</span> <span class='rubyid_options identifier id'>options</span><span class='dot token'>.</span><span class='rubyid_delete identifier id'>delete</span><span class='lparen token'>(</span><span class='symbol val'>:i18n</span><span class='rparen token'>)</span> <span class='orop op'>||</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_xlsx_i18n identifier id'>xlsx_i18n</span>
321
- <span class='rubyid_columns identifier id'>columns</span> <span class='assign token'>=</span> <span class='rubyid_options identifier id'>options</span><span class='dot token'>.</span><span class='rubyid_delete identifier id'>delete</span><span class='lparen token'>(</span><span class='symbol val'>:columns</span><span class='rparen token'>)</span> <span class='orop op'>||</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_xlsx_columns identifier id'>xlsx_columns</span>
322
-
323
- <span class='rubyid_p identifier id'>p</span> <span class='assign token'>=</span> <span class='rubyid_Package constant id'>Package</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span>
324
- <span class='rubyid_row_style identifier id'>row_style</span> <span class='assign token'>=</span> <span class='rubyid_p identifier id'>p</span><span class='dot token'>.</span><span class='rubyid_workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='rubyid_styles identifier id'>styles</span><span class='dot token'>.</span><span class='rubyid_add_style identifier id'>add_style</span><span class='lparen token'>(</span><span class='rubyid_row_style identifier id'>row_style</span><span class='rparen token'>)</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_row_style identifier id'>row_style</span><span class='dot token'>.</span><span class='rubyid_nil? fid id'>nil?</span>
325
- <span class='rubyid_header_style identifier id'>header_style</span> <span class='assign token'>=</span> <span class='rubyid_p identifier id'>p</span><span class='dot token'>.</span><span class='rubyid_workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='rubyid_styles identifier id'>styles</span><span class='dot token'>.</span><span class='rubyid_add_style identifier id'>add_style</span><span class='lparen token'>(</span><span class='rubyid_header_style identifier id'>header_style</span><span class='rparen token'>)</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_header_style identifier id'>header_style</span><span class='dot token'>.</span><span class='rubyid_nil? fid id'>nil?</span>
326
-
327
- <span class='rubyid_data identifier id'>data</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='mult op'>*</span><span class='rubyid_find identifier id'>find</span><span class='lparen token'>(</span><span class='symbol val'>:all</span><span class='comma token'>,</span> <span class='rubyid_options identifier id'>options</span><span class='rparen token'>)</span><span class='rbrack token'>]</span>
328
- <span class='rubyid_data identifier id'>data</span><span class='dot token'>.</span><span class='rubyid_compact! fid id'>compact!</span>
329
- <span class='rubyid_data identifier id'>data</span><span class='dot token'>.</span><span class='rubyid_flatten! fid id'>flatten!</span>
330
-
331
- <span class='rubyid_return return kw'>return</span> <span class='rubyid_p identifier id'>p</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_data identifier id'>data</span><span class='dot token'>.</span><span class='rubyid_empty? fid id'>empty?</span>
332
- <span class='rubyid_p identifier id'>p</span><span class='dot token'>.</span><span class='rubyid_workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='rubyid_add_worksheet identifier id'>add_worksheet</span><span class='lparen token'>(</span><span class='symbol val'>:name=</span><span class='gt op'>&gt;</span><span class='rubyid_table_name identifier id'>table_name</span><span class='dot token'>.</span><span class='rubyid_humanize identifier id'>humanize</span><span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_sheet identifier id'>sheet</span><span class='bitor op'>|</span>
333
-
334
- <span class='rubyid_col_labels identifier id'>col_labels</span> <span class='assign token'>=</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_i18n identifier id'>i18n</span>
335
- <span class='rubyid_columns identifier id'>columns</span><span class='dot token'>.</span><span class='rubyid_map identifier id'>map</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='rubyid_c identifier id'>c</span><span class='bitor op'>|</span> <span class='rubyid_I18n constant id'>I18n</span><span class='dot token'>.</span><span class='rubyid_t identifier id'>t</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{i18n}.#{self.name.underscore}.#{c}&quot;</span><span class='rparen token'>)</span> <span class='rbrace token'>}</span>
336
- <span class='rubyid_else else kw'>else</span>
337
- <span class='rubyid_columns identifier id'>columns</span><span class='dot token'>.</span><span class='rubyid_map identifier id'>map</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='rubyid_c identifier id'>c</span><span class='bitor op'>|</span> <span class='rubyid_c identifier id'>c</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='dot token'>.</span><span class='rubyid_humanize identifier id'>humanize</span> <span class='rbrace token'>}</span>
338
- <span class='rubyid_end end kw'>end</span>
339
-
340
- <span class='rubyid_sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rubyid_add_row identifier id'>add_row</span> <span class='rubyid_col_labels identifier id'>col_labels</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='rubyid_header_style identifier id'>header_style</span>
341
-
342
- <span class='rubyid_data identifier id'>data</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_r identifier id'>r</span><span class='bitor op'>|</span>
343
- <span class='rubyid_row_data identifier id'>row_data</span> <span class='assign token'>=</span> <span class='rubyid_columns identifier id'>columns</span><span class='dot token'>.</span><span class='rubyid_map identifier id'>map</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_c identifier id'>c</span><span class='bitor op'>|</span>
344
- <span class='rubyid_if if kw'>if</span> <span class='rubyid_c identifier id'>c</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span> <span class='match op'>=~</span> <span class='regexp val'>/\./</span>
345
- <span class='rubyid_v identifier id'>v</span> <span class='assign token'>=</span> <span class='rubyid_r identifier id'>r</span><span class='semicolon token'>;</span> <span class='rubyid_c identifier id'>c</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span><span class='dot token'>.</span><span class='rubyid_split identifier id'>split</span><span class='lparen token'>(</span><span class='string val'>'.'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='rubyid_method identifier id'>method</span><span class='bitor op'>|</span> <span class='rubyid_v identifier id'>v</span> <span class='assign token'>=</span> <span class='rubyid_v identifier id'>v</span><span class='dot token'>.</span><span class='rubyid_send identifier id'>send</span><span class='lparen token'>(</span><span class='rubyid_method identifier id'>method</span><span class='rparen token'>)</span> <span class='rbrace token'>}</span><span class='semicolon token'>;</span> <span class='rubyid_v identifier id'>v</span>
346
- <span class='rubyid_else else kw'>else</span>
347
- <span class='rubyid_r identifier id'>r</span><span class='dot token'>.</span><span class='rubyid_send identifier id'>send</span><span class='lparen token'>(</span><span class='rubyid_c identifier id'>c</span><span class='rparen token'>)</span>
348
- <span class='rubyid_end end kw'>end</span>
349
- <span class='rubyid_end end kw'>end</span>
350
- <span class='rubyid_sheet identifier id'>sheet</span><span class='dot token'>.</span><span class='rubyid_add_row identifier id'>add_row</span> <span class='rubyid_row_data identifier id'>row_data</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='rubyid_row_style identifier id'>row_style</span><span class='comma token'>,</span> <span class='symbol val'>:types=</span><span class='gt op'>&gt;</span><span class='rubyid_types identifier id'>types</span>
351
- <span class='rubyid_end end kw'>end</span>
352
- <span class='rubyid_end end kw'>end</span>
353
- <span class='rubyid_p identifier id'>p</span>
354
- <span class='rubyid_end end kw'>end</span>
355
- </pre>
356
- </td>
357
- </tr>
358
- </table>
359
- </div>
360
-
361
- </div>
362
-
363
- </div>
364
-
365
- <div id="footer">
366
- Generated on Tue Dec 6 18:49:19 2011 by
367
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
368
- 0.7.4 (ruby-1.8.7).
369
- </div>
370
-
371
- </body>
372
- </html>
@@ -1,149 +0,0 @@
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
- acts_as_xlsx: a rails plug in for axlsx
8
-
9
- </title>
10
-
11
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
12
-
13
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
14
-
15
- <script type="text/javascript" charset="utf-8">
16
- relpath = '';
17
- if (relpath != '') relpath += '/';
18
- </script>
19
-
20
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
21
-
22
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
23
-
24
-
25
- </head>
26
- <body>
27
- <script type="text/javascript" charset="utf-8">
28
- if (window.top.frames.main) document.body.className = 'frames';
29
- </script>
30
-
31
- <div id="header">
32
- <div id="menu">
33
-
34
-
35
- <span class="title"></span>
36
-
37
-
38
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
39
- </div>
40
-
41
- <div id="search">
42
-
43
- <a id="class_list_link" href="#">Class List</a>
44
-
45
- <a id="method_list_link" href="#">Method List</a>
46
-
47
- <a id="file_list_link" href="#">File List</a>
48
-
49
- </div>
50
- <div class="clear"></div>
51
- </div>
52
-
53
- <iframe id="search_frame"></iframe>
54
-
55
- <div id="content"><h1 class="noborder title">acts_as_xlsx: a rails plug in for axlsx</h1>
56
- <div id="listing">
57
- <h1 class="alphaindex">Alphabetic Index</h1>
58
-
59
- <h2>File Listing</h2>
60
- <ul id="files">
61
-
62
-
63
- <li class="r1"><a href="index.html" title="README">README</a></li>
64
-
65
-
66
- <li class="r2"><a href="file.LICENSE.html" title="LICENSE">LICENSE</a></li>
67
-
68
-
69
- <li class="r1"><a href="file.CHANGELOG.html" title="CHANGELOG">CHANGELOG</a></li>
70
-
71
-
72
- </ul>
73
-
74
- <div class="clear"></div>
75
- <h2>Namespace Listing A-Z</h2>
76
-
77
-
78
-
79
-
80
- <table>
81
- <tr>
82
- <td valign='top' width="33%">
83
-
84
-
85
- <ul id="alpha_A" class="alpha">
86
- <li class="letter">A</li>
87
- <ul>
88
-
89
- <li>
90
- <span class='object_link'><a href="Axlsx/Ar.html" title="Axlsx::Ar (module)">Ar</a></span>
91
-
92
- <small>(Axlsx)</small>
93
-
94
- </li>
95
-
96
- <li>
97
- <span class='object_link'><a href="Axlsx.html" title="Axlsx (module)">Axlsx</a></span>
98
-
99
- </li>
100
-
101
- </ul>
102
- </ul>
103
-
104
-
105
- <ul id="alpha_C" class="alpha">
106
- <li class="letter">C</li>
107
- <ul>
108
-
109
- <li>
110
- <span class='object_link'><a href="Axlsx/Ar/ClassMethods.html" title="Axlsx::Ar::ClassMethods (module)">ClassMethods</a></span>
111
-
112
- <small>(Axlsx::Ar)</small>
113
-
114
- </li>
115
-
116
- </ul>
117
- </ul>
118
-
119
-
120
- <ul id="alpha_S" class="alpha">
121
- <li class="letter">S</li>
122
- <ul>
123
-
124
- <li>
125
- <span class='object_link'><a href="Axlsx/Ar/SingletonMethods.html" title="Axlsx::Ar::SingletonMethods (module)">SingletonMethods</a></span>
126
-
127
- <small>(Axlsx::Ar)</small>
128
-
129
- </li>
130
-
131
- </ul>
132
- </ul>
133
-
134
- </td>
135
- </tr>
136
- </table>
137
-
138
- </div>
139
-
140
- </div>
141
-
142
- <div id="footer">
143
- Generated on Tue Dec 6 18:49:18 2011 by
144
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
145
- 0.7.4 (ruby-1.8.7).
146
- </div>
147
-
148
- </body>
149
- </html>