csv2hash 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/UPGRADE.md +6 -0
- data/config/rules.erb.yml +7 -0
- data/lib/csv2hash/version.rb +1 -1
- data/lib/csv2hash/yaml_loader.rb +12 -1
- data/spec/csv2hash/yaml_loader_spec.rb +15 -8
- metadata +2 -44
- data/doc/Cell.html +0 -282
- data/doc/Csv2hash/Adapter/Abstract.html +0 -215
- data/doc/Csv2hash/Adapter/Base/UnsupportedAdapter.html +0 -123
- data/doc/Csv2hash/Adapter/Base.html +0 -201
- data/doc/Csv2hash/Adapter/CsvAdapter.html +0 -348
- data/doc/Csv2hash/Adapter/MemoryAdapter.html +0 -348
- data/doc/Csv2hash/Adapter.html +0 -117
- data/doc/Csv2hash/DataWrapper.html +0 -500
- data/doc/Csv2hash/Definition.html +0 -1008
- data/doc/Csv2hash/Discover.html +0 -192
- data/doc/Csv2hash/Expectation.html +0 -202
- data/doc/Csv2hash/ExtraValidator.html +0 -207
- data/doc/Csv2hash/Main.html +0 -1298
- data/doc/Csv2hash/Notifier.html +0 -189
- data/doc/Csv2hash/Parser/Collection.html +0 -283
- data/doc/Csv2hash/Parser/Mapping.html +0 -266
- data/doc/Csv2hash/Parser.html +0 -121
- data/doc/Csv2hash/StructureValidator/Deprecation.html +0 -215
- data/doc/Csv2hash/StructureValidator/MaxColumns.html +0 -327
- data/doc/Csv2hash/StructureValidator/MinColumns.html +0 -327
- data/doc/Csv2hash/StructureValidator/ValidationError.html +0 -123
- data/doc/Csv2hash/StructureValidator/Validator.html +0 -184
- data/doc/Csv2hash/StructureValidator.html +0 -311
- data/doc/Csv2hash/Validator/Collection.html +0 -217
- data/doc/Csv2hash/Validator/Mapping.html +0 -200
- data/doc/Csv2hash/Validator.html +0 -295
- data/doc/Csv2hash.html +0 -131
- data/doc/CsvArray.html +0 -200
- data/doc/Registry.html +0 -312
- data/doc/_index.html +0 -391
- data/doc/class_list.html +0 -54
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -339
- data/doc/file.README.html +0 -499
- data/doc/file_list.html +0 -56
- data/doc/frames.html +0 -26
- data/doc/index.html +0 -499
- data/doc/js/app.js +0 -219
- data/doc/js/full_list.js +0 -178
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -473
- data/doc/top-level-namespace.html +0 -114
data/doc/Csv2hash/Main.html
DELETED
@@ -1,1298 +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
|
-
Class: Csv2hash::Main
|
8
|
-
|
9
|
-
— Documentation by YARD 0.8.7.4
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" 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#!Csv2hash/Main.html";
|
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 (M)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../Csv2hash.html" title="Csv2hash (module)">Csv2hash</a></span></span>
|
36
|
-
»
|
37
|
-
<span class="title">Main</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>Class: Csv2hash::Main
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</h1>
|
71
|
-
|
72
|
-
<dl class="box">
|
73
|
-
|
74
|
-
<dt class="r1">Inherits:</dt>
|
75
|
-
<dd class="r1">
|
76
|
-
<span class="inheritName">Object</span>
|
77
|
-
|
78
|
-
<ul class="fullTree">
|
79
|
-
<li>Object</li>
|
80
|
-
|
81
|
-
<li class="next">Csv2hash::Main</li>
|
82
|
-
|
83
|
-
</ul>
|
84
|
-
<a href="#" class="inheritanceTree">show all</a>
|
85
|
-
|
86
|
-
</dd>
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
<dt class="r2">Includes:</dt>
|
94
|
-
<dd class="r2"><span class='object_link'><a href="StructureValidator.html" title="Csv2hash::StructureValidator (module)">StructureValidator</a></span></dd>
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
<dt class="r1 last">Defined in:</dt>
|
101
|
-
<dd class="r1 last">lib/csv2hash.rb</dd>
|
102
|
-
|
103
|
-
</dl>
|
104
|
-
<div class="clear"></div>
|
105
|
-
|
106
|
-
|
107
|
-
<h2>Constant Summary</h2>
|
108
|
-
|
109
|
-
<dl class="constants">
|
110
|
-
|
111
|
-
<dt id="registry-classvariable" class="">@@registry =
|
112
|
-
|
113
|
-
</dt>
|
114
|
-
<dd><pre class="code"><span class='const'>Registry</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span></pre></dd>
|
115
|
-
|
116
|
-
</dl>
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<h3 class="inherited">Constants included
|
124
|
-
from <span class='object_link'><a href="StructureValidator.html" title="Csv2hash::StructureValidator (module)">StructureValidator</a></span></h3>
|
125
|
-
<p class="inherited"><span class='object_link'><a href="StructureValidator.html#MAX_COLUMN-constant" title="Csv2hash::StructureValidator::MAX_COLUMN (constant)">StructureValidator::MAX_COLUMN</a></span>, <span class='object_link'><a href="StructureValidator.html#MIN_COLUMN-constant" title="Csv2hash::StructureValidator::MIN_COLUMN (constant)">StructureValidator::MIN_COLUMN</a></span>, <span class='object_link'><a href="StructureValidator.html#RULES_NAME-constant" title="Csv2hash::StructureValidator::RULES_NAME (constant)">StructureValidator::RULES_NAME</a></span></p>
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
<h3 class="inherited">Constants included
|
130
|
-
from <span class='object_link'><a href="StructureValidator/Deprecation.html" title="Csv2hash::StructureValidator::Deprecation (module)">StructureValidator::Deprecation</a></span></h3>
|
131
|
-
<p class="inherited"><span class='object_link'><a href="StructureValidator/Deprecation.html#NEW_SYNTAX-constant" title="Csv2hash::StructureValidator::Deprecation::NEW_SYNTAX (constant)">StructureValidator::Deprecation::NEW_SYNTAX</a></span>, <span class='object_link'><a href="StructureValidator/Deprecation.html#OLD_MAX_COLUMN-constant" title="Csv2hash::StructureValidator::Deprecation::OLD_MAX_COLUMN (constant)">StructureValidator::Deprecation::OLD_MAX_COLUMN</a></span>, <span class='object_link'><a href="StructureValidator/Deprecation.html#OLD_MIN_COLUMN-constant" title="Csv2hash::StructureValidator::Deprecation::OLD_MIN_COLUMN (constant)">StructureValidator::Deprecation::OLD_MIN_COLUMN</a></span>, <span class='object_link'><a href="StructureValidator/Deprecation.html#OLD_RULES_NAME-constant" title="Csv2hash::StructureValidator::Deprecation::OLD_RULES_NAME (constant)">StructureValidator::Deprecation::OLD_RULES_NAME</a></span></p>
|
132
|
-
|
133
|
-
|
134
|
-
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
135
|
-
<ul class="summary">
|
136
|
-
|
137
|
-
<li class="public ">
|
138
|
-
<span class="summary_signature">
|
139
|
-
|
140
|
-
<a href="#break_on_failure-instance_method" title="#break_on_failure (instance method)">- (Object) <strong>break_on_failure</strong> </a>
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
</span>
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
<span class="summary_desc"><div class='inline'>
|
158
|
-
<p>Returns the value of attribute break_on_failure.</p>
|
159
|
-
</div></span>
|
160
|
-
|
161
|
-
</li>
|
162
|
-
|
163
|
-
|
164
|
-
<li class="public ">
|
165
|
-
<span class="summary_signature">
|
166
|
-
|
167
|
-
<a href="#data-instance_method" title="#data (instance method)">- (Object) <strong>data</strong> </a>
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
</span>
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
<span class="summary_desc"><div class='inline'>
|
185
|
-
<p>Returns the value of attribute data.</p>
|
186
|
-
</div></span>
|
187
|
-
|
188
|
-
</li>
|
189
|
-
|
190
|
-
|
191
|
-
<li class="public ">
|
192
|
-
<span class="summary_signature">
|
193
|
-
|
194
|
-
<a href="#definition-instance_method" title="#definition (instance method)">- (Object) <strong>definition</strong> </a>
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
</span>
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
<span class="summary_desc"><div class='inline'>
|
212
|
-
<p>Returns the value of attribute definition.</p>
|
213
|
-
</div></span>
|
214
|
-
|
215
|
-
</li>
|
216
|
-
|
217
|
-
|
218
|
-
<li class="public ">
|
219
|
-
<span class="summary_signature">
|
220
|
-
|
221
|
-
<a href="#errors-instance_method" title="#errors (instance method)">- (Object) <strong>errors</strong> </a>
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
</span>
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
<span class="summary_desc"><div class='inline'>
|
239
|
-
<p>Returns the value of attribute errors.</p>
|
240
|
-
</div></span>
|
241
|
-
|
242
|
-
</li>
|
243
|
-
|
244
|
-
|
245
|
-
<li class="public ">
|
246
|
-
<span class="summary_signature">
|
247
|
-
|
248
|
-
<a href="#file_path_or_data-instance_method" title="#file_path_or_data (instance method)">- (Object) <strong>file_path_or_data</strong> </a>
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
</span>
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
<span class="summary_desc"><div class='inline'>
|
266
|
-
<p>Returns the value of attribute file_path_or_data.</p>
|
267
|
-
</div></span>
|
268
|
-
|
269
|
-
</li>
|
270
|
-
|
271
|
-
|
272
|
-
<li class="public ">
|
273
|
-
<span class="summary_signature">
|
274
|
-
|
275
|
-
<a href="#notifier-instance_method" title="#notifier (instance method)">- (Object) <strong>notifier</strong> </a>
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
</span>
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
<span class="summary_desc"><div class='inline'>
|
293
|
-
<p>Returns the value of attribute notifier.</p>
|
294
|
-
</div></span>
|
295
|
-
|
296
|
-
</li>
|
297
|
-
|
298
|
-
|
299
|
-
<li class="public ">
|
300
|
-
<span class="summary_signature">
|
301
|
-
|
302
|
-
<a href="#options-instance_method" title="#options (instance method)">- (Object) <strong>options</strong> </a>
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
</span>
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
<span class="summary_desc"><div class='inline'>
|
320
|
-
<p>Returns the value of attribute options.</p>
|
321
|
-
</div></span>
|
322
|
-
|
323
|
-
</li>
|
324
|
-
|
325
|
-
|
326
|
-
</ul>
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
<h2>
|
333
|
-
Class Method Summary
|
334
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
335
|
-
</h2>
|
336
|
-
|
337
|
-
<ul class="summary">
|
338
|
-
|
339
|
-
<li class="public ">
|
340
|
-
<span class="summary_signature">
|
341
|
-
|
342
|
-
<a href="#%5B%5D-class_method" title="[] (class method)">+ (Object) <strong>[]</strong>(definition_name) </a>
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
</span>
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
357
|
-
|
358
|
-
</li>
|
359
|
-
|
360
|
-
|
361
|
-
<li class="public ">
|
362
|
-
<span class="summary_signature">
|
363
|
-
|
364
|
-
<a href="#%5B%5D%3D-class_method" title="[]= (class method)">+ (Object) <strong>[]=</strong>(definition_name, role) </a>
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
</span>
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
379
|
-
|
380
|
-
</li>
|
381
|
-
|
382
|
-
|
383
|
-
<li class="public ">
|
384
|
-
<span class="summary_signature">
|
385
|
-
|
386
|
-
<a href="#generate_definition-class_method" title="generate_definition (class method)">+ (Object) <strong>generate_definition</strong>(name, &block) </a>
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
</span>
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
401
|
-
|
402
|
-
</li>
|
403
|
-
|
404
|
-
|
405
|
-
</ul>
|
406
|
-
|
407
|
-
<h2>
|
408
|
-
Instance Method Summary
|
409
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
410
|
-
</h2>
|
411
|
-
|
412
|
-
<ul class="summary">
|
413
|
-
|
414
|
-
<li class="public ">
|
415
|
-
<span class="summary_signature">
|
416
|
-
|
417
|
-
<a href="#csv_with_errors-instance_method" title="#csv_with_errors (instance method)">- (Object) <strong>csv_with_errors</strong> </a>
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
</span>
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
432
|
-
|
433
|
-
</li>
|
434
|
-
|
435
|
-
|
436
|
-
<li class="public ">
|
437
|
-
<span class="summary_signature">
|
438
|
-
|
439
|
-
<a href="#data_source-instance_method" title="#data_source (instance method)">- (Object) <strong>data_source</strong> </a>
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
(also: #load_data_source)
|
444
|
-
|
445
|
-
</span>
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
<span class="summary_desc"><div class='inline'>
|
456
|
-
<p>protected.</p>
|
457
|
-
</div></span>
|
458
|
-
|
459
|
-
</li>
|
460
|
-
|
461
|
-
|
462
|
-
<li class="public ">
|
463
|
-
<span class="summary_signature">
|
464
|
-
|
465
|
-
<a href="#init_plugins-instance_method" title="#init_plugins (instance method)">- (Object) <strong>init_plugins</strong> </a>
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
</span>
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
480
|
-
|
481
|
-
</li>
|
482
|
-
|
483
|
-
|
484
|
-
<li class="public ">
|
485
|
-
<span class="summary_signature">
|
486
|
-
|
487
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Main) <strong>initialize</strong>(definition, file_path_or_data, *args) </a>
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
</span>
|
492
|
-
|
493
|
-
|
494
|
-
<span class="note title constructor">constructor</span>
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
<span class="summary_desc"><div class='inline'>
|
504
|
-
<p>A new instance of Main.</p>
|
505
|
-
</div></span>
|
506
|
-
|
507
|
-
</li>
|
508
|
-
|
509
|
-
|
510
|
-
<li class="public ">
|
511
|
-
<span class="summary_signature">
|
512
|
-
|
513
|
-
<a href="#parse-instance_method" title="#parse (instance method)">- (Object) <strong>parse</strong> </a>
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
</span>
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
528
|
-
|
529
|
-
</li>
|
530
|
-
|
531
|
-
|
532
|
-
<li class="public ">
|
533
|
-
<span class="summary_signature">
|
534
|
-
|
535
|
-
<a href="#parse%21-instance_method" title="#parse! (instance method)">- (Object) <strong>parse!</strong> </a>
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
</span>
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
550
|
-
|
551
|
-
</li>
|
552
|
-
|
553
|
-
|
554
|
-
</ul>
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
<h3 class="inherited">Methods included from <span class='object_link'><a href="StructureValidator.html" title="Csv2hash::StructureValidator (module)">StructureValidator</a></span></h3>
|
567
|
-
<p class="inherited"><span class='object_link'><a href="StructureValidator.html#rule_instance-instance_method" title="Csv2hash::StructureValidator#rule_instance (method)">#rule_instance</a></span>, <span class='object_link'><a href="StructureValidator.html#validate_structure%21-instance_method" title="Csv2hash::StructureValidator#validate_structure! (method)">#validate_structure!</a></span></p>
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
<h3 class="inherited">Methods included from <span class='object_link'><a href="StructureValidator/Deprecation.html" title="Csv2hash::StructureValidator::Deprecation (module)">StructureValidator::Deprecation</a></span></h3>
|
578
|
-
<p class="inherited"><span class='object_link'><a href="StructureValidator/Deprecation.html#check_params-instance_method" title="Csv2hash::StructureValidator::Deprecation#check_params (method)">#check_params</a></span></p>
|
579
|
-
<div id="constructor_details" class="method_details_list">
|
580
|
-
<h2>Constructor Details</h2>
|
581
|
-
|
582
|
-
<div class="method_details first">
|
583
|
-
<h3 class="signature first" id="initialize-instance_method">
|
584
|
-
|
585
|
-
- (<tt><span class='object_link'><a href="" title="Csv2hash::Main (class)">Main</a></span></tt>) <strong>initialize</strong>(definition, file_path_or_data, *args)
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
</h3><div class="docstring">
|
592
|
-
<div class="discussion">
|
593
|
-
|
594
|
-
<p>Returns a new instance of Main</p>
|
595
|
-
|
596
|
-
|
597
|
-
</div>
|
598
|
-
</div>
|
599
|
-
<div class="tags">
|
600
|
-
|
601
|
-
|
602
|
-
</div><table class="source_code">
|
603
|
-
<tr>
|
604
|
-
<td>
|
605
|
-
<pre class="lines">
|
606
|
-
|
607
|
-
|
608
|
-
51
|
609
|
-
52
|
610
|
-
53
|
611
|
-
54
|
612
|
-
55
|
613
|
-
56
|
614
|
-
57
|
615
|
-
58
|
616
|
-
59
|
617
|
-
60
|
618
|
-
61
|
619
|
-
62
|
620
|
-
63</pre>
|
621
|
-
</td>
|
622
|
-
<td>
|
623
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 51</span>
|
624
|
-
|
625
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_definition'>definition</span><span class='comma'>,</span> <span class='id identifier rubyid_file_path_or_data'>file_path_or_data</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span>
|
626
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_extract_options!'>extract_options!</span>
|
627
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_definition'>definition</span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_file_path_or_data'>file_path_or_data</span> <span class='op'>=</span> <span class='id identifier rubyid_definition'>definition</span><span class='comma'>,</span> <span class='id identifier rubyid_file_path_or_data'>file_path_or_data</span>
|
628
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_break_on_failure'>break_on_failure</span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span> <span class='op'>=</span> <span class='kw'>false</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
629
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_notifier'>notifier</span> <span class='op'>=</span> <span class='const'>Notifier</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
630
|
-
|
631
|
-
<span class='id identifier rubyid_dynamic_lib_loading'>dynamic_lib_loading</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Parser</span><span class='tstring_end'>'</span></span>
|
632
|
-
<span class='id identifier rubyid_dynamic_lib_loading'>dynamic_lib_loading</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Validator</span><span class='tstring_end'>'</span></span>
|
633
|
-
|
634
|
-
<span class='ivar'>@data_source</span> <span class='op'>=</span> <span class='id identifier rubyid_data_source'>data_source</span>
|
635
|
-
|
636
|
-
<span class='id identifier rubyid_init_plugins'>init_plugins</span>
|
637
|
-
<span class='kw'>end</span></pre>
|
638
|
-
</td>
|
639
|
-
</tr>
|
640
|
-
</table>
|
641
|
-
</div>
|
642
|
-
|
643
|
-
</div>
|
644
|
-
|
645
|
-
<div id="instance_attr_details" class="attr_details">
|
646
|
-
<h2>Instance Attribute Details</h2>
|
647
|
-
|
648
|
-
|
649
|
-
<span id="break_on_failure=-instance_method"></span>
|
650
|
-
<div class="method_details first">
|
651
|
-
<h3 class="signature first" id="break_on_failure-instance_method">
|
652
|
-
|
653
|
-
- (<tt>Object</tt>) <strong>break_on_failure</strong>
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
</h3><div class="docstring">
|
660
|
-
<div class="discussion">
|
661
|
-
|
662
|
-
<p>Returns the value of attribute break_on_failure</p>
|
663
|
-
|
664
|
-
|
665
|
-
</div>
|
666
|
-
</div>
|
667
|
-
<div class="tags">
|
668
|
-
|
669
|
-
|
670
|
-
</div><table class="source_code">
|
671
|
-
<tr>
|
672
|
-
<td>
|
673
|
-
<pre class="lines">
|
674
|
-
|
675
|
-
|
676
|
-
49
|
677
|
-
50
|
678
|
-
51</pre>
|
679
|
-
</td>
|
680
|
-
<td>
|
681
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 49</span>
|
682
|
-
|
683
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_break_on_failure'>break_on_failure</span>
|
684
|
-
<span class='ivar'>@break_on_failure</span>
|
685
|
-
<span class='kw'>end</span></pre>
|
686
|
-
</td>
|
687
|
-
</tr>
|
688
|
-
</table>
|
689
|
-
</div>
|
690
|
-
|
691
|
-
|
692
|
-
<span id="data=-instance_method"></span>
|
693
|
-
<div class="method_details ">
|
694
|
-
<h3 class="signature " id="data-instance_method">
|
695
|
-
|
696
|
-
- (<tt>Object</tt>) <strong>data</strong>
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
</h3><div class="docstring">
|
703
|
-
<div class="discussion">
|
704
|
-
|
705
|
-
<p>Returns the value of attribute data</p>
|
706
|
-
|
707
|
-
|
708
|
-
</div>
|
709
|
-
</div>
|
710
|
-
<div class="tags">
|
711
|
-
|
712
|
-
|
713
|
-
</div><table class="source_code">
|
714
|
-
<tr>
|
715
|
-
<td>
|
716
|
-
<pre class="lines">
|
717
|
-
|
718
|
-
|
719
|
-
49
|
720
|
-
50
|
721
|
-
51</pre>
|
722
|
-
</td>
|
723
|
-
<td>
|
724
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 49</span>
|
725
|
-
|
726
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_data'>data</span>
|
727
|
-
<span class='ivar'>@data</span>
|
728
|
-
<span class='kw'>end</span></pre>
|
729
|
-
</td>
|
730
|
-
</tr>
|
731
|
-
</table>
|
732
|
-
</div>
|
733
|
-
|
734
|
-
|
735
|
-
<span id="definition=-instance_method"></span>
|
736
|
-
<div class="method_details ">
|
737
|
-
<h3 class="signature " id="definition-instance_method">
|
738
|
-
|
739
|
-
- (<tt>Object</tt>) <strong>definition</strong>
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
</h3><div class="docstring">
|
746
|
-
<div class="discussion">
|
747
|
-
|
748
|
-
<p>Returns the value of attribute definition</p>
|
749
|
-
|
750
|
-
|
751
|
-
</div>
|
752
|
-
</div>
|
753
|
-
<div class="tags">
|
754
|
-
|
755
|
-
|
756
|
-
</div><table class="source_code">
|
757
|
-
<tr>
|
758
|
-
<td>
|
759
|
-
<pre class="lines">
|
760
|
-
|
761
|
-
|
762
|
-
49
|
763
|
-
50
|
764
|
-
51</pre>
|
765
|
-
</td>
|
766
|
-
<td>
|
767
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 49</span>
|
768
|
-
|
769
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_definition'>definition</span>
|
770
|
-
<span class='ivar'>@definition</span>
|
771
|
-
<span class='kw'>end</span></pre>
|
772
|
-
</td>
|
773
|
-
</tr>
|
774
|
-
</table>
|
775
|
-
</div>
|
776
|
-
|
777
|
-
|
778
|
-
<span id="errors=-instance_method"></span>
|
779
|
-
<div class="method_details ">
|
780
|
-
<h3 class="signature " id="errors-instance_method">
|
781
|
-
|
782
|
-
- (<tt>Object</tt>) <strong>errors</strong>
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
</h3><div class="docstring">
|
789
|
-
<div class="discussion">
|
790
|
-
|
791
|
-
<p>Returns the value of attribute errors</p>
|
792
|
-
|
793
|
-
|
794
|
-
</div>
|
795
|
-
</div>
|
796
|
-
<div class="tags">
|
797
|
-
|
798
|
-
|
799
|
-
</div><table class="source_code">
|
800
|
-
<tr>
|
801
|
-
<td>
|
802
|
-
<pre class="lines">
|
803
|
-
|
804
|
-
|
805
|
-
49
|
806
|
-
50
|
807
|
-
51</pre>
|
808
|
-
</td>
|
809
|
-
<td>
|
810
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 49</span>
|
811
|
-
|
812
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_errors'>errors</span>
|
813
|
-
<span class='ivar'>@errors</span>
|
814
|
-
<span class='kw'>end</span></pre>
|
815
|
-
</td>
|
816
|
-
</tr>
|
817
|
-
</table>
|
818
|
-
</div>
|
819
|
-
|
820
|
-
|
821
|
-
<span id="file_path_or_data=-instance_method"></span>
|
822
|
-
<div class="method_details ">
|
823
|
-
<h3 class="signature " id="file_path_or_data-instance_method">
|
824
|
-
|
825
|
-
- (<tt>Object</tt>) <strong>file_path_or_data</strong>
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
</h3><div class="docstring">
|
832
|
-
<div class="discussion">
|
833
|
-
|
834
|
-
<p>Returns the value of attribute file_path_or_data</p>
|
835
|
-
|
836
|
-
|
837
|
-
</div>
|
838
|
-
</div>
|
839
|
-
<div class="tags">
|
840
|
-
|
841
|
-
|
842
|
-
</div><table class="source_code">
|
843
|
-
<tr>
|
844
|
-
<td>
|
845
|
-
<pre class="lines">
|
846
|
-
|
847
|
-
|
848
|
-
49
|
849
|
-
50
|
850
|
-
51</pre>
|
851
|
-
</td>
|
852
|
-
<td>
|
853
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 49</span>
|
854
|
-
|
855
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_file_path_or_data'>file_path_or_data</span>
|
856
|
-
<span class='ivar'>@file_path_or_data</span>
|
857
|
-
<span class='kw'>end</span></pre>
|
858
|
-
</td>
|
859
|
-
</tr>
|
860
|
-
</table>
|
861
|
-
</div>
|
862
|
-
|
863
|
-
|
864
|
-
<span id="notifier=-instance_method"></span>
|
865
|
-
<div class="method_details ">
|
866
|
-
<h3 class="signature " id="notifier-instance_method">
|
867
|
-
|
868
|
-
- (<tt>Object</tt>) <strong>notifier</strong>
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
</h3><div class="docstring">
|
875
|
-
<div class="discussion">
|
876
|
-
|
877
|
-
<p>Returns the value of attribute notifier</p>
|
878
|
-
|
879
|
-
|
880
|
-
</div>
|
881
|
-
</div>
|
882
|
-
<div class="tags">
|
883
|
-
|
884
|
-
|
885
|
-
</div><table class="source_code">
|
886
|
-
<tr>
|
887
|
-
<td>
|
888
|
-
<pre class="lines">
|
889
|
-
|
890
|
-
|
891
|
-
49
|
892
|
-
50
|
893
|
-
51</pre>
|
894
|
-
</td>
|
895
|
-
<td>
|
896
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 49</span>
|
897
|
-
|
898
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_notifier'>notifier</span>
|
899
|
-
<span class='ivar'>@notifier</span>
|
900
|
-
<span class='kw'>end</span></pre>
|
901
|
-
</td>
|
902
|
-
</tr>
|
903
|
-
</table>
|
904
|
-
</div>
|
905
|
-
|
906
|
-
|
907
|
-
<span id="options=-instance_method"></span>
|
908
|
-
<div class="method_details ">
|
909
|
-
<h3 class="signature " id="options-instance_method">
|
910
|
-
|
911
|
-
- (<tt>Object</tt>) <strong>options</strong>
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
</h3><div class="docstring">
|
918
|
-
<div class="discussion">
|
919
|
-
|
920
|
-
<p>Returns the value of attribute options</p>
|
921
|
-
|
922
|
-
|
923
|
-
</div>
|
924
|
-
</div>
|
925
|
-
<div class="tags">
|
926
|
-
|
927
|
-
|
928
|
-
</div><table class="source_code">
|
929
|
-
<tr>
|
930
|
-
<td>
|
931
|
-
<pre class="lines">
|
932
|
-
|
933
|
-
|
934
|
-
49
|
935
|
-
50
|
936
|
-
51</pre>
|
937
|
-
</td>
|
938
|
-
<td>
|
939
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 49</span>
|
940
|
-
|
941
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
|
942
|
-
<span class='ivar'>@options</span>
|
943
|
-
<span class='kw'>end</span></pre>
|
944
|
-
</td>
|
945
|
-
</tr>
|
946
|
-
</table>
|
947
|
-
</div>
|
948
|
-
|
949
|
-
</div>
|
950
|
-
|
951
|
-
|
952
|
-
<div id="class_method_details" class="method_details_list">
|
953
|
-
<h2>Class Method Details</h2>
|
954
|
-
|
955
|
-
|
956
|
-
<div class="method_details first">
|
957
|
-
<h3 class="signature first" id="[]-class_method">
|
958
|
-
|
959
|
-
+ (<tt>Object</tt>) <strong>[]</strong>(definition_name)
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
</h3><table class="source_code">
|
966
|
-
<tr>
|
967
|
-
<td>
|
968
|
-
<pre class="lines">
|
969
|
-
|
970
|
-
|
971
|
-
38
|
972
|
-
39
|
973
|
-
40</pre>
|
974
|
-
</td>
|
975
|
-
<td>
|
976
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 38</span>
|
977
|
-
|
978
|
-
<span class='kw'>def</span> <span class='op'>[]</span> <span class='id identifier rubyid_definition_name'>definition_name</span>
|
979
|
-
<span class='cvar'>@@registry</span><span class='lbracket'>[</span><span class='id identifier rubyid_definition_name'>definition_name</span><span class='rbracket'>]</span>
|
980
|
-
<span class='kw'>end</span></pre>
|
981
|
-
</td>
|
982
|
-
</tr>
|
983
|
-
</table>
|
984
|
-
</div>
|
985
|
-
|
986
|
-
<div class="method_details ">
|
987
|
-
<h3 class="signature " id="[]=-class_method">
|
988
|
-
|
989
|
-
+ (<tt>Object</tt>) <strong>[]=</strong>(definition_name, role)
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
</h3><table class="source_code">
|
996
|
-
<tr>
|
997
|
-
<td>
|
998
|
-
<pre class="lines">
|
999
|
-
|
1000
|
-
|
1001
|
-
42
|
1002
|
-
43
|
1003
|
-
44</pre>
|
1004
|
-
</td>
|
1005
|
-
<td>
|
1006
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 42</span>
|
1007
|
-
|
1008
|
-
<span class='kw'>def</span> <span class='op'>[]=</span> <span class='id identifier rubyid_definition_name'>definition_name</span><span class='comma'>,</span> <span class='id identifier rubyid_role'>role</span>
|
1009
|
-
<span class='cvar'>@@registry</span><span class='lbracket'>[</span><span class='id identifier rubyid_definition_name'>definition_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_role'>role</span>
|
1010
|
-
<span class='kw'>end</span></pre>
|
1011
|
-
</td>
|
1012
|
-
</tr>
|
1013
|
-
</table>
|
1014
|
-
</div>
|
1015
|
-
|
1016
|
-
<div class="method_details ">
|
1017
|
-
<h3 class="signature " id="generate_definition-class_method">
|
1018
|
-
|
1019
|
-
+ (<tt>Object</tt>) <strong>generate_definition</strong>(name, &block)
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
</h3><table class="source_code">
|
1026
|
-
<tr>
|
1027
|
-
<td>
|
1028
|
-
<pre class="lines">
|
1029
|
-
|
1030
|
-
|
1031
|
-
33
|
1032
|
-
34
|
1033
|
-
35
|
1034
|
-
36</pre>
|
1035
|
-
</td>
|
1036
|
-
<td>
|
1037
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 33</span>
|
1038
|
-
|
1039
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_generate_definition'>generate_definition</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
1040
|
-
<span class='id identifier rubyid_definition'>definition</span> <span class='op'>=</span> <span class='const'>Definition</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
1041
|
-
<span class='const'>Main</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_definition'>definition</span>
|
1042
|
-
<span class='kw'>end</span></pre>
|
1043
|
-
</td>
|
1044
|
-
</tr>
|
1045
|
-
</table>
|
1046
|
-
</div>
|
1047
|
-
|
1048
|
-
</div>
|
1049
|
-
|
1050
|
-
<div id="instance_method_details" class="method_details_list">
|
1051
|
-
<h2>Instance Method Details</h2>
|
1052
|
-
|
1053
|
-
|
1054
|
-
<div class="method_details first">
|
1055
|
-
<h3 class="signature first" id="csv_with_errors-instance_method">
|
1056
|
-
|
1057
|
-
- (<tt>Object</tt>) <strong>csv_with_errors</strong>
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
</h3><table class="source_code">
|
1064
|
-
<tr>
|
1065
|
-
<td>
|
1066
|
-
<pre class="lines">
|
1067
|
-
|
1068
|
-
|
1069
|
-
101
|
1070
|
-
102
|
1071
|
-
103
|
1072
|
-
104
|
1073
|
-
105
|
1074
|
-
106
|
1075
|
-
107
|
1076
|
-
108
|
1077
|
-
109</pre>
|
1078
|
-
</td>
|
1079
|
-
<td>
|
1080
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 101</span>
|
1081
|
-
|
1082
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_csv_with_errors'>csv_with_errors</span>
|
1083
|
-
<span class='ivar'>@csv_with_errors</span> <span class='op'>||=</span> <span class='kw'>begin</span>
|
1084
|
-
<span class='const'>CsvArray</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_rows'>rows</span><span class='op'>|</span>
|
1085
|
-
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_error'>error</span><span class='op'>|</span>
|
1086
|
-
<span class='id identifier rubyid_rows'>rows</span> <span class='op'><<</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='lbrace'>{</span> <span class='label'>value:</span> <span class='lparen'>(</span><span class='id identifier rubyid_data_source'>data_source</span><span class='lbracket'>[</span><span class='id identifier rubyid_error'>error</span><span class='lbracket'>[</span><span class='symbol'>:y</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_error'>error</span><span class='lbracket'>[</span><span class='symbol'>:x</span><span class='rbracket'>]</span><span class='rbracket'>]</span> <span class='kw'>rescue</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
1087
|
-
<span class='kw'>end</span>
|
1088
|
-
<span class='kw'>end</span> <span class='comment'>#.to_csv
|
1089
|
-
</span> <span class='kw'>end</span>
|
1090
|
-
<span class='kw'>end</span></pre>
|
1091
|
-
</td>
|
1092
|
-
</tr>
|
1093
|
-
</table>
|
1094
|
-
</div>
|
1095
|
-
|
1096
|
-
<div class="method_details ">
|
1097
|
-
<h3 class="signature " id="data_source-instance_method">
|
1098
|
-
|
1099
|
-
- (<tt>Object</tt>) <strong>data_source</strong>
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
<span class="aliases">Also known as:
|
1104
|
-
<span class="names"><span id='load_data_source-instance_method'>load_data_source</span></span>
|
1105
|
-
</span>
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
</h3><div class="docstring">
|
1110
|
-
<div class="discussion">
|
1111
|
-
|
1112
|
-
<p>protected</p>
|
1113
|
-
|
1114
|
-
|
1115
|
-
</div>
|
1116
|
-
</div>
|
1117
|
-
<div class="tags">
|
1118
|
-
|
1119
|
-
|
1120
|
-
</div><table class="source_code">
|
1121
|
-
<tr>
|
1122
|
-
<td>
|
1123
|
-
<pre class="lines">
|
1124
|
-
|
1125
|
-
|
1126
|
-
113
|
1127
|
-
114
|
1128
|
-
115
|
1129
|
-
116
|
1130
|
-
117
|
1131
|
-
118
|
1132
|
-
119</pre>
|
1133
|
-
</td>
|
1134
|
-
<td>
|
1135
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 113</span>
|
1136
|
-
|
1137
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_data_source'>data_source</span>
|
1138
|
-
<span class='ivar'>@data_source</span> <span class='op'>||=</span> <span class='kw'>begin</span>
|
1139
|
-
<span class='id identifier rubyid_adapter_name'>adapter_name</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_file_path_or_data'>file_path_or_data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='symbol'>:csv</span> <span class='op'>:</span> <span class='symbol'>:memory</span>
|
1140
|
-
<span class='id identifier rubyid_adapter'>adapter</span> <span class='op'>=</span> <span class='const'>Adapter</span><span class='op'>::</span><span class='const'>Base</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_adapter_name'>adapter_name</span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_file_path_or_data'>file_path_or_data</span><span class='rparen'>)</span>
|
1141
|
-
<span class='id identifier rubyid_adapter'>adapter</span><span class='period'>.</span><span class='id identifier rubyid_source'>source</span>
|
1142
|
-
<span class='kw'>end</span>
|
1143
|
-
<span class='kw'>end</span></pre>
|
1144
|
-
</td>
|
1145
|
-
</tr>
|
1146
|
-
</table>
|
1147
|
-
</div>
|
1148
|
-
|
1149
|
-
<div class="method_details ">
|
1150
|
-
<h3 class="signature " id="init_plugins-instance_method">
|
1151
|
-
|
1152
|
-
- (<tt>Object</tt>) <strong>init_plugins</strong>
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
</h3><table class="source_code">
|
1159
|
-
<tr>
|
1160
|
-
<td>
|
1161
|
-
<pre class="lines">
|
1162
|
-
|
1163
|
-
|
1164
|
-
65
|
1165
|
-
66
|
1166
|
-
67
|
1167
|
-
68
|
1168
|
-
69
|
1169
|
-
70
|
1170
|
-
71
|
1171
|
-
72</pre>
|
1172
|
-
</td>
|
1173
|
-
<td>
|
1174
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 65</span>
|
1175
|
-
|
1176
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_init_plugins'>init_plugins</span>
|
1177
|
-
<span class='kw'>begin</span>
|
1178
|
-
<span class='ivar'>@plugins</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1179
|
-
<span class='op'>::</span><span class='const'>Csv2hash</span><span class='op'>::</span><span class='const'>Plugins</span><span class='period'>.</span><span class='id identifier rubyid_constants'>constants</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='op'>|</span>
|
1180
|
-
<span class='ivar'>@plugins</span> <span class='op'><<</span> <span class='op'>::</span><span class='const'>Csv2hash</span><span class='op'>::</span><span class='const'>Plugins</span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
1181
|
-
<span class='kw'>end</span>
|
1182
|
-
<span class='kw'>rescue</span><span class='semicolon'>;</span> <span class='kw'>end</span>
|
1183
|
-
<span class='kw'>end</span></pre>
|
1184
|
-
</td>
|
1185
|
-
</tr>
|
1186
|
-
</table>
|
1187
|
-
</div>
|
1188
|
-
|
1189
|
-
<div class="method_details ">
|
1190
|
-
<h3 class="signature " id="parse-instance_method">
|
1191
|
-
|
1192
|
-
- (<tt>Object</tt>) <strong>parse</strong>
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
</h3><table class="source_code">
|
1199
|
-
<tr>
|
1200
|
-
<td>
|
1201
|
-
<pre class="lines">
|
1202
|
-
|
1203
|
-
|
1204
|
-
81
|
1205
|
-
82
|
1206
|
-
83
|
1207
|
-
84
|
1208
|
-
85
|
1209
|
-
86
|
1210
|
-
87
|
1211
|
-
88
|
1212
|
-
89
|
1213
|
-
90
|
1214
|
-
91
|
1215
|
-
92
|
1216
|
-
93
|
1217
|
-
94
|
1218
|
-
95
|
1219
|
-
96
|
1220
|
-
97
|
1221
|
-
98
|
1222
|
-
99</pre>
|
1223
|
-
</td>
|
1224
|
-
<td>
|
1225
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 81</span>
|
1226
|
-
|
1227
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span>
|
1228
|
-
<span class='id identifier rubyid_load_data_source'>load_data_source</span>
|
1229
|
-
|
1230
|
-
<span class='id identifier rubyid_definition'>definition</span><span class='period'>.</span><span class='id identifier rubyid_validate!'>validate!</span>
|
1231
|
-
<span class='id identifier rubyid_definition'>definition</span><span class='period'>.</span><span class='id identifier rubyid_default!'>default!</span>
|
1232
|
-
<span class='id identifier rubyid_validate_structure!'>validate_structure!</span>
|
1233
|
-
<span class='id identifier rubyid_validate_data!'>validate_data!</span>
|
1234
|
-
|
1235
|
-
<span class='const'>Csv2hash</span><span class='op'>::</span><span class='const'>DataWrapper</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_response'>response</span><span class='op'>|</span>
|
1236
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_valid?'>valid?</span>
|
1237
|
-
<span class='id identifier rubyid_fill!'>fill!</span>
|
1238
|
-
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span>
|
1239
|
-
<span class='kw'>else</span>
|
1240
|
-
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_valid'>valid</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1241
|
-
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_errors'>errors</span> <span class='op'>=</span> <span class='id identifier rubyid_csv_with_errors'>csv_with_errors</span>
|
1242
|
-
<span class='id identifier rubyid_notifier'>notifier</span><span class='period'>.</span><span class='id identifier rubyid_notify'>notify</span> <span class='id identifier rubyid_response'>response</span>
|
1243
|
-
<span class='kw'>end</span>
|
1244
|
-
<span class='kw'>end</span>
|
1245
|
-
<span class='kw'>end</span></pre>
|
1246
|
-
</td>
|
1247
|
-
</tr>
|
1248
|
-
</table>
|
1249
|
-
</div>
|
1250
|
-
|
1251
|
-
<div class="method_details ">
|
1252
|
-
<h3 class="signature " id="parse!-instance_method">
|
1253
|
-
|
1254
|
-
- (<tt>Object</tt>) <strong>parse!</strong>
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
</h3><table class="source_code">
|
1261
|
-
<tr>
|
1262
|
-
<td>
|
1263
|
-
<pre class="lines">
|
1264
|
-
|
1265
|
-
|
1266
|
-
74
|
1267
|
-
75
|
1268
|
-
76
|
1269
|
-
77
|
1270
|
-
78
|
1271
|
-
79</pre>
|
1272
|
-
</td>
|
1273
|
-
<td>
|
1274
|
-
<pre class="code"><span class="info file"># File 'lib/csv2hash.rb', line 74</span>
|
1275
|
-
|
1276
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_parse!'>parse!</span>
|
1277
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_break_on_failure'>break_on_failure</span> <span class='op'>=</span> <span class='kw'>true</span>
|
1278
|
-
<span class='id identifier rubyid_parse'>parse</span>
|
1279
|
-
<span class='kw'>ensure</span>
|
1280
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_break_on_failure'>break_on_failure</span> <span class='op'>=</span> <span class='kw'>false</span>
|
1281
|
-
<span class='kw'>end</span></pre>
|
1282
|
-
</td>
|
1283
|
-
</tr>
|
1284
|
-
</table>
|
1285
|
-
</div>
|
1286
|
-
|
1287
|
-
</div>
|
1288
|
-
|
1289
|
-
</div>
|
1290
|
-
|
1291
|
-
<div id="footer">
|
1292
|
-
Generated on Fri Aug 29 17:12:26 2014 by
|
1293
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1294
|
-
0.8.7.4 (ruby-2.1.2).
|
1295
|
-
</div>
|
1296
|
-
|
1297
|
-
</body>
|
1298
|
-
</html>
|