sycsvpro 0.0.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.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +2 -0
  5. data/Gemfile.lock +51 -0
  6. data/LICENSE +20 -0
  7. data/README.md +188 -0
  8. data/README.rdoc +44 -0
  9. data/Rakefile +44 -0
  10. data/bin/sycsvpro +208 -0
  11. data/features/step_definitions/sycsvpro_steps.rb +6 -0
  12. data/features/support/env.rb +15 -0
  13. data/features/sycsvpro.feature +8 -0
  14. data/html/Dsl.html +201 -0
  15. data/html/Object.html +116 -0
  16. data/html/README_rdoc.html +178 -0
  17. data/html/Sycsvpro/Analyzer.html +239 -0
  18. data/html/Sycsvpro/Calculator.html +354 -0
  19. data/html/Sycsvpro/Collector.html +281 -0
  20. data/html/Sycsvpro/ColumnFilter.html +165 -0
  21. data/html/Sycsvpro/Counter.html +397 -0
  22. data/html/Sycsvpro/Extractor.html +269 -0
  23. data/html/Sycsvpro/Filter.html +349 -0
  24. data/html/Sycsvpro/Header.html +228 -0
  25. data/html/Sycsvpro/Mapper.html +288 -0
  26. data/html/Sycsvpro/Profiler.html +234 -0
  27. data/html/Sycsvpro/RowFilter.html +162 -0
  28. data/html/Sycsvpro.html +141 -0
  29. data/html/created.rid +17 -0
  30. data/html/fonts/Lato-Light.ttf +0 -0
  31. data/html/fonts/Lato-LightItalic.ttf +0 -0
  32. data/html/fonts/Lato-Regular.ttf +0 -0
  33. data/html/fonts/Lato-RegularItalic.ttf +0 -0
  34. data/html/fonts/SourceCodePro-Bold.ttf +0 -0
  35. data/html/fonts/SourceCodePro-Regular.ttf +0 -0
  36. data/html/fonts.css +167 -0
  37. data/html/images/add.png +0 -0
  38. data/html/images/arrow_up.png +0 -0
  39. data/html/images/brick.png +0 -0
  40. data/html/images/brick_link.png +0 -0
  41. data/html/images/bug.png +0 -0
  42. data/html/images/bullet_black.png +0 -0
  43. data/html/images/bullet_toggle_minus.png +0 -0
  44. data/html/images/bullet_toggle_plus.png +0 -0
  45. data/html/images/date.png +0 -0
  46. data/html/images/delete.png +0 -0
  47. data/html/images/find.png +0 -0
  48. data/html/images/loadingAnimation.gif +0 -0
  49. data/html/images/macFFBgHack.png +0 -0
  50. data/html/images/package.png +0 -0
  51. data/html/images/page_green.png +0 -0
  52. data/html/images/page_white_text.png +0 -0
  53. data/html/images/page_white_width.png +0 -0
  54. data/html/images/plugin.png +0 -0
  55. data/html/images/ruby.png +0 -0
  56. data/html/images/tag_blue.png +0 -0
  57. data/html/images/tag_green.png +0 -0
  58. data/html/images/transparent.png +0 -0
  59. data/html/images/wrench.png +0 -0
  60. data/html/images/wrench_orange.png +0 -0
  61. data/html/images/zoom.png +0 -0
  62. data/html/index.html +202 -0
  63. data/html/js/darkfish.js +140 -0
  64. data/html/js/jquery.js +18 -0
  65. data/html/js/navigation.js +142 -0
  66. data/html/js/search.js +109 -0
  67. data/html/js/search_index.js +1 -0
  68. data/html/js/searcher.js +228 -0
  69. data/html/rdoc.css +580 -0
  70. data/html/table_of_contents.html +236 -0
  71. data/lib/sycsvpro/analyzer.rb +40 -0
  72. data/lib/sycsvpro/calculator.rb +94 -0
  73. data/lib/sycsvpro/collector.rb +60 -0
  74. data/lib/sycsvpro/column_filter.rb +23 -0
  75. data/lib/sycsvpro/counter.rb +74 -0
  76. data/lib/sycsvpro/dsl.rb +37 -0
  77. data/lib/sycsvpro/extractor.rb +39 -0
  78. data/lib/sycsvpro/filter.rb +98 -0
  79. data/lib/sycsvpro/header.rb +29 -0
  80. data/lib/sycsvpro/mapper.rb +53 -0
  81. data/lib/sycsvpro/profiler.rb +26 -0
  82. data/lib/sycsvpro/row_filter.rb +20 -0
  83. data/lib/sycsvpro/version.rb +5 -0
  84. data/lib/sycsvpro.rb +9 -0
  85. data/spec/sycsvpro/analyze_spec.rb +23 -0
  86. data/spec/sycsvpro/calculator_spec.rb +45 -0
  87. data/spec/sycsvpro/collector_spec.rb +27 -0
  88. data/spec/sycsvpro/counter_spec.rb +51 -0
  89. data/spec/sycsvpro/extractor_spec.rb +27 -0
  90. data/spec/sycsvpro/files/mappings +6 -0
  91. data/spec/sycsvpro/files/profile.rb +42 -0
  92. data/spec/sycsvpro/mapper_spec.rb +33 -0
  93. data/spec/sycsvpro/profiler_spec.rb +32 -0
  94. data/sycsvpro.gemspec +24 -0
  95. data/sycsvpro.rdoc +29 -0
  96. metadata +215 -0
@@ -0,0 +1,349 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Sycsvpro::Filter - Your application title</title>
8
+
9
+ <link href="../fonts.css" rel="stylesheet">
10
+ <link href="../rdoc.css" rel="stylesheet">
11
+
12
+ <script type="text/javascript">
13
+ var rdoc_rel_prefix = "../";
14
+ </script>
15
+
16
+ <script src="../js/jquery.js"></script>
17
+ <script src="../js/navigation.js"></script>
18
+ <script src="../js/search_index.js"></script>
19
+ <script src="../js/search.js"></script>
20
+ <script src="../js/searcher.js"></script>
21
+ <script src="../js/darkfish.js"></script>
22
+
23
+
24
+ <body id="top" role="document" class="class">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="../index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="../table_of_contents.html#pages">Pages</a>
34
+ <a href="../table_of_contents.html#classes">Classes</a>
35
+ <a href="../table_of_contents.html#methods">Methods</a>
36
+ </div>
37
+ </div>
38
+
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
40
+ <form action="#" method="get" accept-charset="utf-8">
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
45
+ title="Type to search, Up and Down to navigate, Enter to load">
46
+ </div>
47
+
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
53
+
54
+ </div>
55
+
56
+
57
+
58
+ <div id="class-metadata">
59
+
60
+ <div id="parent-class-section" class="nav-section">
61
+ <h3>Parent</h3>
62
+
63
+
64
+ <p class="link"><a href="../Object.html">Object</a>
65
+
66
+ </div>
67
+
68
+
69
+
70
+ <!-- Method Quickref -->
71
+ <div id="method-list-section" class="nav-section">
72
+ <h3>Methods</h3>
73
+
74
+ <ul class="link-list" role="directory">
75
+
76
+ <li ><a href="#method-c-new">::new</a>
77
+
78
+ <li class="calls-super" ><a href="#method-i-method_missing">#method_missing</a>
79
+
80
+ <li ><a href="#method-i-pivot_each_column">#pivot_each_column</a>
81
+
82
+ <li ><a href="#method-i-process">#process</a>
83
+
84
+ </ul>
85
+ </div>
86
+
87
+ </div>
88
+ </nav>
89
+
90
+ <main role="main" aria-labelledby="class-Sycsvpro::Filter">
91
+ <h1 id="class-Sycsvpro::Filter" class="class">
92
+ class Sycsvpro::Filter
93
+ </h1>
94
+
95
+ <section class="description">
96
+
97
+ <p>Creates a new filter that can be extended by sub-classes. A sub-class needs
98
+ to override the process method</p>
99
+
100
+ </section>
101
+
102
+
103
+
104
+
105
+ <section id="5Buntitled-5D" class="documentation-section">
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+ <section class="attribute-method-details" class="method-section">
114
+ <header>
115
+ <h3>Attributes</h3>
116
+ </header>
117
+
118
+
119
+ <div id="attribute-i-date_format" class="method-detail">
120
+ <div class="method-heading attribute-method-heading">
121
+ <span class="method-name">date_format</span><span
122
+ class="attribute-access-type">[R]</span>
123
+ </div>
124
+
125
+ <div class="method-description">
126
+
127
+ <p>When date are used as filters the date format has to be provided</p>
128
+
129
+ </div>
130
+ </div>
131
+
132
+ <div id="attribute-i-filter" class="method-detail">
133
+ <div class="method-heading attribute-method-heading">
134
+ <span class="method-name">filter</span><span
135
+ class="attribute-access-type">[R]</span>
136
+ </div>
137
+
138
+ <div class="method-description">
139
+
140
+ <p><a href="Filter.html">Filter</a> for rows and columns</p>
141
+
142
+ </div>
143
+ </div>
144
+
145
+ <div id="attribute-i-pattern" class="method-detail">
146
+ <div class="method-heading attribute-method-heading">
147
+ <span class="method-name">pattern</span><span
148
+ class="attribute-access-type">[R]</span>
149
+ </div>
150
+
151
+ <div class="method-description">
152
+
153
+ <p>Pattern that is used as a filter</p>
154
+
155
+ </div>
156
+ </div>
157
+
158
+ <div id="attribute-i-pivot" class="method-detail">
159
+ <div class="method-heading attribute-method-heading">
160
+ <span class="method-name">pivot</span><span
161
+ class="attribute-access-type">[R]</span>
162
+ </div>
163
+
164
+ <div class="method-description">
165
+
166
+ <p>Comparison that is used as a filter</p>
167
+
168
+ </div>
169
+ </div>
170
+
171
+ </section>
172
+
173
+
174
+
175
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
176
+ <header>
177
+ <h3>Public Class Methods</h3>
178
+ </header>
179
+
180
+
181
+ <div id="method-c-new" class="method-detail ">
182
+
183
+ <div class="method-heading">
184
+ <span class="method-name">new</span><span
185
+ class="method-args">(values, options={})</span>
186
+
187
+ <span class="method-click-advice">click to toggle source</span>
188
+
189
+ </div>
190
+
191
+
192
+ <div class="method-description">
193
+
194
+ <p>Creates a new filter</p>
195
+
196
+
197
+
198
+
199
+ <div class="method-source-code" id="new-source">
200
+ <pre><span class="ruby-comment"># File lib/sycsvpro/filter.rb, line 20</span>
201
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">values</span>, <span class="ruby-identifier">options</span>={})
202
+ <span class="ruby-ivar">@date_format</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:df</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&quot;%Y-%m-%d&quot;</span>
203
+ <span class="ruby-ivar">@filter</span> = []
204
+ <span class="ruby-ivar">@pattern</span> = []
205
+ <span class="ruby-ivar">@pivot</span> = {}
206
+ <span class="ruby-identifier">create_filter</span>(<span class="ruby-identifier">values</span>)
207
+ <span class="ruby-keyword">end</span></pre>
208
+ </div>
209
+
210
+ </div>
211
+
212
+
213
+
214
+
215
+ </div>
216
+
217
+
218
+ </section>
219
+
220
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
221
+ <header>
222
+ <h3>Public Instance Methods</h3>
223
+ </header>
224
+
225
+
226
+ <div id="method-i-method_missing" class="method-detail ">
227
+
228
+ <div class="method-heading">
229
+ <span class="method-name">method_missing</span><span
230
+ class="method-args">(id, *args, &block)</span>
231
+
232
+ <span class="method-click-advice">click to toggle source</span>
233
+
234
+ </div>
235
+
236
+
237
+ <div class="method-description">
238
+
239
+ <p>Creates the filters based on the given patterns</p>
240
+
241
+
242
+ <div class="method-calls-super">
243
+ Calls superclass method
244
+
245
+ </div>
246
+
247
+
248
+
249
+ <div class="method-source-code" id="method_missing-source">
250
+ <pre><span class="ruby-comment"># File lib/sycsvpro/filter.rb, line 29</span>
251
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">id</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
252
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">equal</span>(<span class="ruby-node">$1</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">id</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^(\d+)$/</span>
253
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">range</span>(<span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">id</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^(\d+)-(\d+)$/</span>
254
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">regex</span>(<span class="ruby-node">$1</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">id</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^\/(.*)\/$/</span>
255
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">col_regex</span>(<span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">id</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^(\d+):\/(.*)\/$/</span>
256
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">date</span>(<span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>, <span class="ruby-node">$3</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">id</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^(\d+):(&lt;|=|&gt;)(\d+.\d+.\d+)/</span>
257
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">date_range</span>(<span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>, <span class="ruby-node">$3</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">id</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^(\d+):(\d+.\d+.\d+.)-(\d+.\d+.\d+)$/</span>
258
+ <span class="ruby-keyword">super</span>
259
+ <span class="ruby-keyword">end</span></pre>
260
+ </div>
261
+
262
+ </div>
263
+
264
+
265
+
266
+
267
+ </div>
268
+
269
+
270
+ <div id="method-i-pivot_each_column" class="method-detail ">
271
+
272
+ <div class="method-heading">
273
+ <span class="method-name">pivot_each_column</span><span
274
+ class="method-args">(values=[]) { |column, eval(gsub('[value]', values[parameters))| ... }</span>
275
+
276
+ <span class="method-click-advice">click to toggle source</span>
277
+
278
+ </div>
279
+
280
+
281
+ <div class="method-description">
282
+
283
+ <p>Yields the column value and whether the filter matches the column</p>
284
+
285
+
286
+
287
+
288
+ <div class="method-source-code" id="pivot_each_column-source">
289
+ <pre><span class="ruby-comment"># File lib/sycsvpro/filter.rb, line 45</span>
290
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">pivot_each_column</span>(<span class="ruby-identifier">values</span>=[])
291
+ <span class="ruby-identifier">pivot</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">column</span>, <span class="ruby-identifier">parameters</span><span class="ruby-operator">|</span>
292
+ <span class="ruby-keyword">yield</span> <span class="ruby-identifier">column</span>, <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">parameters</span>[<span class="ruby-value">:operation</span>].<span class="ruby-identifier">gsub</span>(<span class="ruby-string">&#39;[value]&#39;</span>, <span class="ruby-identifier">values</span>[<span class="ruby-identifier">parameters</span>[<span class="ruby-value">:col</span>].<span class="ruby-identifier">to_i</span>]))
293
+ <span class="ruby-keyword">end</span>
294
+ <span class="ruby-keyword">end</span></pre>
295
+ </div>
296
+
297
+ </div>
298
+
299
+
300
+
301
+
302
+ </div>
303
+
304
+
305
+ <div id="method-i-process" class="method-detail ">
306
+
307
+ <div class="method-heading">
308
+ <span class="method-name">process</span><span
309
+ class="method-args">(object, options={})</span>
310
+
311
+ <span class="method-click-advice">click to toggle source</span>
312
+
313
+ </div>
314
+
315
+
316
+ <div class="method-description">
317
+
318
+ <p>Processes the filter. Needs to be overridden by the sub-class</p>
319
+
320
+
321
+
322
+
323
+ <div class="method-source-code" id="process-source">
324
+ <pre><span class="ruby-comment"># File lib/sycsvpro/filter.rb, line 40</span>
325
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">options</span>={})
326
+ <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Needs to be overridden by sub class&#39;</span>
327
+ <span class="ruby-keyword">end</span></pre>
328
+ </div>
329
+
330
+ </div>
331
+
332
+
333
+
334
+
335
+ </div>
336
+
337
+
338
+ </section>
339
+
340
+ </section>
341
+ </main>
342
+
343
+
344
+ <footer id="validator-badges" role="contentinfo">
345
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
346
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
347
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
348
+ </footer>
349
+
@@ -0,0 +1,228 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Sycsvpro::Header - Your application title</title>
8
+
9
+ <link href="../fonts.css" rel="stylesheet">
10
+ <link href="../rdoc.css" rel="stylesheet">
11
+
12
+ <script type="text/javascript">
13
+ var rdoc_rel_prefix = "../";
14
+ </script>
15
+
16
+ <script src="../js/jquery.js"></script>
17
+ <script src="../js/navigation.js"></script>
18
+ <script src="../js/search_index.js"></script>
19
+ <script src="../js/search.js"></script>
20
+ <script src="../js/searcher.js"></script>
21
+ <script src="../js/darkfish.js"></script>
22
+
23
+
24
+ <body id="top" role="document" class="class">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="../index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="../table_of_contents.html#pages">Pages</a>
34
+ <a href="../table_of_contents.html#classes">Classes</a>
35
+ <a href="../table_of_contents.html#methods">Methods</a>
36
+ </div>
37
+ </div>
38
+
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
40
+ <form action="#" method="get" accept-charset="utf-8">
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
45
+ title="Type to search, Up and Down to navigate, Enter to load">
46
+ </div>
47
+
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
53
+
54
+ </div>
55
+
56
+
57
+
58
+ <div id="class-metadata">
59
+
60
+ <div id="parent-class-section" class="nav-section">
61
+ <h3>Parent</h3>
62
+
63
+
64
+ <p class="link"><a href="Filter.html">Sycsvpro::Filter</a>
65
+
66
+ </div>
67
+
68
+
69
+
70
+ <!-- Method Quickref -->
71
+ <div id="method-list-section" class="nav-section">
72
+ <h3>Methods</h3>
73
+
74
+ <ul class="link-list" role="directory">
75
+
76
+ <li ><a href="#method-c-new">::new</a>
77
+
78
+ <li ><a href="#method-i-process">#process</a>
79
+
80
+ </ul>
81
+ </div>
82
+
83
+ </div>
84
+ </nav>
85
+
86
+ <main role="main" aria-labelledby="class-Sycsvpro::Header">
87
+ <h1 id="class-Sycsvpro::Header" class="class">
88
+ class Sycsvpro::Header
89
+ </h1>
90
+
91
+ <section class="description">
92
+
93
+ <p>Creates a header</p>
94
+
95
+ </section>
96
+
97
+
98
+
99
+
100
+ <section id="5Buntitled-5D" class="documentation-section">
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ <section class="attribute-method-details" class="method-section">
109
+ <header>
110
+ <h3>Attributes</h3>
111
+ </header>
112
+
113
+
114
+ <div id="attribute-i-header_cols" class="method-detail">
115
+ <div class="method-heading attribute-method-heading">
116
+ <span class="method-name">header_cols</span><span
117
+ class="attribute-access-type">[R]</span>
118
+ </div>
119
+
120
+ <div class="method-description">
121
+
122
+ <p><a href="Header.html">Header</a> columns</p>
123
+
124
+ </div>
125
+ </div>
126
+
127
+ </section>
128
+
129
+
130
+
131
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
132
+ <header>
133
+ <h3>Public Class Methods</h3>
134
+ </header>
135
+
136
+
137
+ <div id="method-c-new" class="method-detail ">
138
+
139
+ <div class="method-heading">
140
+ <span class="method-name">new</span><span
141
+ class="method-args">(header)</span>
142
+
143
+ <span class="method-click-advice">click to toggle source</span>
144
+
145
+ </div>
146
+
147
+
148
+ <div class="method-description">
149
+
150
+ <p>Create a new header</p>
151
+
152
+
153
+
154
+
155
+ <div class="method-source-code" id="new-source">
156
+ <pre><span class="ruby-comment"># File lib/sycsvpro/header.rb, line 13</span>
157
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">header</span>)
158
+ <span class="ruby-keyword">unless</span> <span class="ruby-identifier">header</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">header</span>.<span class="ruby-identifier">empty?</span>
159
+ <span class="ruby-ivar">@header_cols</span> = <span class="ruby-identifier">header</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;,&#39;</span>)
160
+ <span class="ruby-keyword">else</span>
161
+ <span class="ruby-ivar">@header_cols</span> = []
162
+ <span class="ruby-keyword">end</span>
163
+ <span class="ruby-keyword">end</span></pre>
164
+ </div>
165
+
166
+ </div>
167
+
168
+
169
+
170
+
171
+ </div>
172
+
173
+
174
+ </section>
175
+
176
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
177
+ <header>
178
+ <h3>Public Instance Methods</h3>
179
+ </header>
180
+
181
+
182
+ <div id="method-i-process" class="method-detail ">
183
+
184
+ <div class="method-heading">
185
+ <span class="method-name">process</span><span
186
+ class="method-args">(line)</span>
187
+
188
+ <span class="method-click-advice">click to toggle source</span>
189
+
190
+ </div>
191
+
192
+
193
+ <div class="method-description">
194
+
195
+ <p>Returns the header</p>
196
+
197
+
198
+
199
+
200
+ <div class="method-source-code" id="process-source">
201
+ <pre><span class="ruby-comment"># File lib/sycsvpro/header.rb, line 22</span>
202
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">line</span>)
203
+ <span class="ruby-keyword">return</span> <span class="ruby-string">&quot;&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@header_cols</span>.<span class="ruby-identifier">empty?</span>
204
+ <span class="ruby-ivar">@header_cols</span>[<span class="ruby-value">0</span>] = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;;&#39;</span>)
205
+ <span class="ruby-ivar">@header_cols</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39;;&#39;</span>)
206
+ <span class="ruby-keyword">end</span></pre>
207
+ </div>
208
+
209
+ </div>
210
+
211
+
212
+
213
+
214
+ </div>
215
+
216
+
217
+ </section>
218
+
219
+ </section>
220
+ </main>
221
+
222
+
223
+ <footer id="validator-badges" role="contentinfo">
224
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
225
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
226
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
227
+ </footer>
228
+