marc4j4r 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -72,7 +72,9 @@
72
72
 
73
73
 
74
74
  <dt class="r2 last">Defined in:</dt>
75
- <dd class="r2 last">lib/marc4j4r.rb</dd>
75
+ <dd class="r2 last">lib/marc4j4r/ruby_marc_compatibility.rb<span class="defines">,<br />
76
+ lib/marc4j4r.rb</span>
77
+ </dd>
76
78
 
77
79
  </dl>
78
80
  <div class="clear"></div>
@@ -80,14 +82,14 @@
80
82
 
81
83
 
82
84
 
83
- <h2>Instance Method Summary</h2>
85
+ <h2>Class Method Summary</h2>
84
86
 
85
87
  <ul class="summary">
86
88
 
87
89
  <li class="public ">
88
90
  <span class="summary_signature">
89
91
 
90
- <a href="#to_s-instance_method" title="#to_s (instance method)">- (Object) <strong>to_s</strong> </a>
92
+ <a href="#control_tag%3F-class_method" title="control_tag? (class method)">+ (Boolean) <strong>control_tag?</strong>(tag) </a>
91
93
 
92
94
 
93
95
 
@@ -99,18 +101,21 @@
99
101
 
100
102
 
101
103
 
102
- <span class="summary_desc">
103
- Pretty-print.
104
-
105
- </span>
104
+ <span class="summary_desc"></span>
106
105
 
107
106
  </li>
108
107
 
109
108
 
109
+ </ul>
110
+
111
+ <h2>Instance Method Summary</h2>
112
+
113
+ <ul class="summary">
114
+
110
115
  <li class="public ">
111
116
  <span class="summary_signature">
112
117
 
113
- <a href="#value-instance_method" title="#value (instance method)">- (Object) <strong>value</strong> </a>
118
+ <a href="#controlField%3F-instance_method" title="#controlField? (instance method)">- (Boolean) <strong>controlField?</strong> </a>
114
119
 
115
120
 
116
121
 
@@ -130,7 +135,30 @@ Pretty-print.
130
135
  <li class="public ">
131
136
  <span class="summary_signature">
132
137
 
133
- <a href="#via_tagspec-instance_method" title="#via_tagspec (instance method)">- (Object) <strong>via_tagspec</strong>(tagspec) </a>
138
+ <a href="#to_s-instance_method" title="#to_s (instance method)">- (Object) <strong>to_s</strong> </a>
139
+
140
+
141
+
142
+ </span>
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <span class="summary_desc">
151
+ Pretty-print.
152
+
153
+ </span>
154
+
155
+ </li>
156
+
157
+
158
+ <li class="public ">
159
+ <span class="summary_signature">
160
+
161
+ <a href="#value-instance_method" title="#value (instance method)">- (Object) <strong>value</strong> </a>
134
162
 
135
163
 
136
164
 
@@ -150,12 +178,118 @@ Pretty-print.
150
178
  </ul>
151
179
 
152
180
 
181
+ <div id="class_method_details" class="method_details_list">
182
+ <h2>Class Method Details</h2>
183
+
184
+
185
+ <div class="method_details first">
186
+ <p class="signature first" id="control_tag?-class_method">
187
+
188
+ + (<tt>Boolean</tt>) <strong>control_tag?</strong>(tag)
189
+
190
+
191
+
192
+ </p><div class="docstring">
193
+ <div class="discussion">
194
+
195
+
196
+ </div>
197
+ </div>
198
+ <div class="tags">
199
+ <h3>Returns:</h3>
200
+ <ul class="return">
201
+
202
+ <li>
203
+
204
+ <span class='type'>(<tt>Boolean</tt>)</span>
205
+
206
+
207
+
208
+
209
+ </li>
210
+
211
+ </ul>
212
+
213
+ </div><table class="source_code">
214
+ <tr>
215
+ <td>
216
+ <pre class="lines">
217
+
218
+
219
+ 371
220
+ 372
221
+ 373</pre>
222
+ </td>
223
+ <td>
224
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 371</span>
225
+
226
+ <span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='control_tag? fid id'>control_tag?</span> <span class='tag identifier id'>tag</span>
227
+ <span class='return return kw'>return</span> <span class='Java constant id'>Java</span><span class='colon2 op'>::</span><span class='org identifier id'>org</span><span class='dot token'>.</span><span class='marc4j identifier id'>marc4j</span><span class='dot token'>.</span><span class='marc identifier id'>marc</span><span class='dot token'>.</span><span class='impl identifier id'>impl</span><span class='dot token'>.</span><span class='Verifier constant id'>Verifier</span><span class='dot token'>.</span><span class='isControlField identifier id'>isControlField</span> <span class='tag identifier id'>tag</span>
228
+ <span class='end end kw'>end</span>
229
+ </pre>
230
+ </td>
231
+ </tr>
232
+ </table>
233
+ </div>
234
+
235
+ </div>
236
+
153
237
  <div id="instance_method_details" class="method_details_list">
154
238
  <h2>Instance Method Details</h2>
155
239
 
156
240
 
157
241
  <div class="method_details first">
158
- <p class="signature first" id="to_s-instance_method">
242
+ <p class="signature first" id="controlField?-instance_method">
243
+
244
+ - (<tt>Boolean</tt>) <strong>controlField?</strong>
245
+
246
+
247
+
248
+ </p><div class="docstring">
249
+ <div class="discussion">
250
+
251
+
252
+ </div>
253
+ </div>
254
+ <div class="tags">
255
+ <h3>Returns:</h3>
256
+ <ul class="return">
257
+
258
+ <li>
259
+
260
+ <span class='type'>(<tt>Boolean</tt>)</span>
261
+
262
+
263
+
264
+
265
+ </li>
266
+
267
+ </ul>
268
+
269
+ </div><table class="source_code">
270
+ <tr>
271
+ <td>
272
+ <pre class="lines">
273
+
274
+
275
+ 367
276
+ 368
277
+ 369</pre>
278
+ </td>
279
+ <td>
280
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 367</span>
281
+
282
+ <span class='def def kw'>def</span> <span class='controlField? fid id'>controlField?</span>
283
+ <span class='return return kw'>return</span> <span class='true true kw'>true</span>
284
+ <span class='end end kw'>end</span>
285
+ </pre>
286
+ </td>
287
+ </tr>
288
+ </table>
289
+ </div>
290
+
291
+ <div class="method_details ">
292
+ <p class="signature " id="to_s-instance_method">
159
293
 
160
294
  - (<tt>Object</tt>) <strong>to_s</strong>
161
295
 
@@ -216,12 +350,12 @@ pretty string
216
350
  <pre class="lines">
217
351
 
218
352
 
219
- 251
220
- 252
221
- 253</pre>
353
+ 378
354
+ 379
355
+ 380</pre>
222
356
  </td>
223
357
  <td>
224
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 251</span>
358
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 378</span>
225
359
 
226
360
  <span class='def def kw'>def</span> <span class='to_s identifier id'>to_s</span>
227
361
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='tag identifier id'>tag</span> <span class='plus op'>+</span> <span class='string val'>&quot; &quot;</span> <span class='plus op'>+</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='value identifier id'>value</span>
@@ -245,12 +379,12 @@ pretty string
245
379
  <pre class="lines">
246
380
 
247
381
 
248
- 234
249
- 235
250
- 236</pre>
382
+ 363
383
+ 364
384
+ 365</pre>
251
385
  </td>
252
386
  <td>
253
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 234</span>
387
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 363</span>
254
388
 
255
389
  <span class='def def kw'>def</span> <span class='value identifier id'>value</span>
256
390
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='data identifier id'>data</span>
@@ -259,45 +393,6 @@ pretty string
259
393
  </td>
260
394
  </tr>
261
395
  </table>
262
- </div>
263
-
264
- <div class="method_details ">
265
- <p class="signature " id="via_tagspec-instance_method">
266
-
267
- - (<tt>Object</tt>) <strong>via_tagspec</strong>(tagspec)
268
-
269
-
270
-
271
- </p><table class="source_code">
272
- <tr>
273
- <td>
274
- <pre class="lines">
275
-
276
-
277
- 239
278
- 240
279
- 241
280
- 242
281
- 243
282
- 244
283
- 245
284
- 246</pre>
285
- </td>
286
- <td>
287
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 239</span>
288
-
289
- <span class='def def kw'>def</span> <span class='via_tagspec identifier id'>via_tagspec</span><span class='lparen token'>(</span><span class='tagspec identifier id'>tagspec</span><span class='rparen token'>)</span>
290
- <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='getData identifier id'>getData</span> <span class='unless unless_mod kw'>unless</span> <span class='lparen token'>(</span><span class='tagspec identifier id'>tagspec</span><span class='dot token'>.</span><span class='start identifier id'>start</span><span class='rparen token'>)</span>
291
- <span class='len identifier id'>len</span> <span class='assign token'>=</span> <span class='integer val'>1</span>
292
- <span class='if if kw'>if</span> <span class='tagspec identifier id'>tagspec</span><span class='dot token'>.</span><span class='end identifier id'>end</span>
293
- <span class='len identifier id'>len</span> <span class='assign token'>=</span> <span class='tagspec identifier id'>tagspec</span><span class='dot token'>.</span><span class='end identifier id'>end</span><span class='dot token'>.</span><span class='to_i identifier id'>to_i</span> <span class='minus op'>-</span> <span class='tagspec identifier id'>tagspec</span><span class='dot token'>.</span><span class='start identifier id'>start</span><span class='dot token'>.</span><span class='to_i identifier id'>to_i</span>
294
- <span class='end end kw'>end</span>
295
- <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='getData identifier id'>getData</span><span class='lbrack token'>[</span><span class='tagspec identifier id'>tagspec</span><span class='dot token'>.</span><span class='start identifier id'>start</span><span class='dot token'>.</span><span class='to_i identifier id'>to_i</span> <span class='comma token'>,</span> <span class='len identifier id'>len</span><span class='rbrack token'>]</span>
296
- <span class='end end kw'>end</span>
297
- </pre>
298
- </td>
299
- </tr>
300
- </table>
301
396
  </div>
302
397
 
303
398
  </div>
@@ -305,7 +400,7 @@ pretty string
305
400
  </div>
306
401
 
307
402
  <div id="footer">
308
- Generated on Fri Feb 12 16:38:06 2010 by
403
+ Generated on Sat Apr 3 22:01:08 2010 by
309
404
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
310
405
  0.5.3 (ruby-1.8.7).
311
406
  </div>
@@ -92,7 +92,7 @@
92
92
  <li class="public ">
93
93
  <span class="summary_signature">
94
94
 
95
- <a href="#%5B%5D-instance_method" title="#[] (instance method)">- (String) <strong>[]</strong>(code) </a>
95
+ <a href="#%3D%3D-instance_method" title="#== (instance method)">- (Object) <strong>=</strong>(other) </a>
96
96
 
97
97
 
98
98
 
@@ -105,7 +105,7 @@
105
105
 
106
106
 
107
107
  <span class="summary_desc">
108
- Get the value of the first subfield of this field with the given code.
108
+ Broken.
109
109
 
110
110
  </span>
111
111
 
@@ -115,7 +115,7 @@ Get the value of the first subfield of this field with the given code.
115
115
  <li class="public ">
116
116
  <span class="summary_signature">
117
117
 
118
- <a href="#each-instance_method" title="#each (instance method)">- (Object) <strong>each</strong> </a>
118
+ <a href="#%5B%5D-instance_method" title="#[] (instance method)">- (String) <strong>[]</strong>(code) </a>
119
119
 
120
120
 
121
121
 
@@ -128,7 +128,7 @@ Get the value of the first subfield of this field with the given code.
128
128
 
129
129
 
130
130
  <span class="summary_desc">
131
- Iterate over the subfields.
131
+ Get the value of the first subfield of this field with the given code.
132
132
 
133
133
  </span>
134
134
 
@@ -138,7 +138,27 @@ Iterate over the subfields.
138
138
  <li class="public ">
139
139
  <span class="summary_signature">
140
140
 
141
- <a href="#indicator1-instance_method" title="#indicator1 (instance method)">- (Object) <strong>indicator1</strong> </a>
141
+ <a href="#controlField%3F-instance_method" title="#controlField? (instance method)">- (Boolean) <strong>controlField?</strong> </a>
142
+
143
+
144
+
145
+ </span>
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+ <span class="summary_desc"></span>
154
+
155
+ </li>
156
+
157
+
158
+ <li class="public ">
159
+ <span class="summary_signature">
160
+
161
+ <a href="#each-instance_method" title="#each (instance method)">- (Object) <strong>each</strong> </a>
142
162
 
143
163
 
144
164
 
@@ -151,7 +171,7 @@ Iterate over the subfields.
151
171
 
152
172
 
153
173
  <span class="summary_desc">
154
- Get first indicator as a one-character string.
174
+ Iterate over the subfields.
155
175
 
156
176
  </span>
157
177
 
@@ -161,7 +181,7 @@ Get first indicator as a one-character string.
161
181
  <li class="public ">
162
182
  <span class="summary_signature">
163
183
 
164
- <a href="#indicator2-instance_method" title="#indicator2 (instance method)">- (Object) <strong>indicator2</strong> </a>
184
+ <a href="#indicator1-instance_method" title="#indicator1 (instance method)">- (Object) <strong>indicator1</strong> </a>
165
185
 
166
186
 
167
187
 
@@ -174,7 +194,7 @@ Get first indicator as a one-character string.
174
194
 
175
195
 
176
196
  <span class="summary_desc">
177
- Get second indicator as a one-character string.
197
+ Get first indicator as a one-character string.
178
198
 
179
199
  </span>
180
200
 
@@ -184,7 +204,7 @@ Get second indicator as a one-character string.
184
204
  <li class="public ">
185
205
  <span class="summary_signature">
186
206
 
187
- <a href="#sub_values-instance_method" title="#sub_values (instance method)">- (Array&lt;String&gt;) <strong>sub_values</strong>(code, myorder = false) </a>
207
+ <a href="#indicator2-instance_method" title="#indicator2 (instance method)">- (Object) <strong>indicator2</strong> </a>
188
208
 
189
209
 
190
210
 
@@ -197,7 +217,7 @@ Get second indicator as a one-character string.
197
217
 
198
218
 
199
219
  <span class="summary_desc">
200
- Get all values from the subfields for the given code or array of codes.
220
+ Get second indicator as a one-character string.
201
221
 
202
222
  </span>
203
223
 
@@ -207,7 +227,7 @@ Get all values from the subfields for the given code or array of codes.
207
227
  <li class="public ">
208
228
  <span class="summary_signature">
209
229
 
210
- <a href="#to_s-instance_method" title="#to_s (instance method)">- (Object) <strong>to_s</strong>(joiner = ' ') </a>
230
+ <a href="#sub_values-instance_method" title="#sub_values (instance method)">- (Array&lt;String&gt;) <strong>sub_values</strong>(code, myorder = false) </a>
211
231
 
212
232
 
213
233
 
@@ -220,7 +240,7 @@ Get all values from the subfields for the given code or array of codes.
220
240
 
221
241
 
222
242
  <span class="summary_desc">
223
- Pretty-print.
243
+ Get all values from the subfields for the given code or array of codes.
224
244
 
225
245
  </span>
226
246
 
@@ -230,7 +250,7 @@ Pretty-print.
230
250
  <li class="public ">
231
251
  <span class="summary_signature">
232
252
 
233
- <a href="#value-instance_method" title="#value (instance method)">- (Object) <strong>value</strong>(joiner = ' ') </a>
253
+ <a href="#to_s-instance_method" title="#to_s (instance method)">- (Object) <strong>to_s</strong>(joiner = ' ') </a>
234
254
 
235
255
 
236
256
 
@@ -243,8 +263,7 @@ Pretty-print.
243
263
 
244
264
 
245
265
  <span class="summary_desc">
246
- Get the concatentated values of the subfields in order the appear in the
247
- field.
266
+ Pretty-print.
248
267
 
249
268
  </span>
250
269
 
@@ -254,7 +273,7 @@ field.
254
273
  <li class="public ">
255
274
  <span class="summary_signature">
256
275
 
257
- <a href="#via_tagspec-instance_method" title="#via_tagspec (instance method)">- (Object) <strong>via_tagspec</strong>(tagspec) </a>
276
+ <a href="#value-instance_method" title="#value (instance method)">- (Object) <strong>value</strong>(joiner = ' ') </a>
258
277
 
259
278
 
260
279
 
@@ -266,7 +285,11 @@ field.
266
285
 
267
286
 
268
287
 
269
- <span class="summary_desc"></span>
288
+ <span class="summary_desc">
289
+ Get the concatentated values of the subfields in order the appear in the
290
+ field.
291
+
292
+ </span>
270
293
 
271
294
  </li>
272
295
 
@@ -280,7 +303,51 @@ field.
280
303
 
281
304
 
282
305
  <div class="method_details first">
283
- <p class="signature first" id="[]-instance_method">
306
+ <p class="signature first" id="==-instance_method">
307
+
308
+ - (<tt>Object</tt>) <strong>==</strong>(other)
309
+
310
+
311
+
312
+ </p><div class="docstring">
313
+ <div class="discussion">
314
+ <p>
315
+ Broken. Need to check subs as well
316
+ </p>
317
+
318
+
319
+ </div>
320
+ </div>
321
+ <div class="tags">
322
+
323
+ </div><table class="source_code">
324
+ <tr>
325
+ <td>
326
+ <pre class="lines">
327
+
328
+
329
+ 395
330
+ 396
331
+ 397
332
+ 398
333
+ 399</pre>
334
+ </td>
335
+ <td>
336
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 395</span>
337
+
338
+ <span class='def def kw'>def</span> <span class='eq op'>==</span> <span class='other identifier id'>other</span>
339
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='tag identifier id'>tag</span> <span class='eq op'>==</span> <span class='other identifier id'>other</span><span class='dot token'>.</span><span class='tag identifier id'>tag</span> <span class='and and kw'>and</span>
340
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='indicator1 identifier id'>indicator1</span> <span class='eq op'>==</span> <span class='other identifier id'>other</span><span class='dot token'>.</span><span class='indicator1 identifier id'>indicator1</span> <span class='and and kw'>and</span>
341
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='indicator2 identifier id'>indicator2</span> <span class='eq op'>==</span> <span class='other identifier id'>other</span><span class='dot token'>.</span><span class='indicator2 identifier id'>indicator2</span>
342
+ <span class='end end kw'>end</span>
343
+ </pre>
344
+ </td>
345
+ </tr>
346
+ </table>
347
+ </div>
348
+
349
+ <div class="method_details ">
350
+ <p class="signature " id="[]-instance_method">
284
351
 
285
352
  - (<tt>String</tt>) <strong>[]</strong>(code)
286
353
 
@@ -356,21 +423,79 @@ The value of the first matched subfield
356
423
  <pre class="lines">
357
424
 
358
425
 
359
- 296
360
- 297
361
- 298
362
- 299
363
- 300
364
- 301</pre>
426
+ 415
427
+ 416
428
+ 417
429
+ 418
430
+ 419
431
+ 420
432
+ 421
433
+ 422
434
+ 423
435
+ 424</pre>
365
436
  </td>
366
437
  <td>
367
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 296</span>
438
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 415</span>
368
439
 
369
440
  <span class='def def kw'>def</span> <span class='aref op'>[]</span> <span class='code identifier id'>code</span>
370
441
  <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='dstring node'>&quot;Code must be a one-character string, not #{code}&quot;</span> <span class='unless unless_mod kw'>unless</span> <span class='code identifier id'>code</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span> <span class='String constant id'>String</span> <span class='and and kw'>and</span> <span class='code identifier id'>code</span><span class='dot token'>.</span><span class='size identifier id'>size</span> <span class='eq op'>==</span> <span class='integer val'>1</span>
371
- <span class='comment val'># note that code[0] is just converting the one-character string into an integer </span>
372
- <span class='comment val'># char value that the underlying java can deal with</span>
373
- <span class='self self kw'>self</span><span class='dot token'>.</span><span class='getSubfield identifier id'>getSubfield</span><span class='lparen token'>(</span><span class='code identifier id'>code</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='getData identifier id'>getData</span>
442
+ <span class='comment val'># need to send a char value that the underlying java can deal with</span>
443
+ <span class='sub identifier id'>sub</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='getSubfield identifier id'>getSubfield</span><span class='lparen token'>(</span><span class='code identifier id'>code</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='ord identifier id'>ord</span><span class='rparen token'>)</span>
444
+ <span class='if if kw'>if</span> <span class='lparen token'>(</span><span class='sub identifier id'>sub</span><span class='rparen token'>)</span>
445
+ <span class='return return kw'>return</span> <span class='sub identifier id'>sub</span><span class='dot token'>.</span><span class='getData identifier id'>getData</span>
446
+ <span class='else else kw'>else</span>
447
+ <span class='return return kw'>return</span> <span class='nil nil kw'>nil</span>
448
+ <span class='end end kw'>end</span>
449
+ <span class='end end kw'>end</span>
450
+ </pre>
451
+ </td>
452
+ </tr>
453
+ </table>
454
+ </div>
455
+
456
+ <div class="method_details ">
457
+ <p class="signature " id="controlField?-instance_method">
458
+
459
+ - (<tt>Boolean</tt>) <strong>controlField?</strong>
460
+
461
+
462
+
463
+ </p><div class="docstring">
464
+ <div class="discussion">
465
+
466
+
467
+ </div>
468
+ </div>
469
+ <div class="tags">
470
+ <h3>Returns:</h3>
471
+ <ul class="return">
472
+
473
+ <li>
474
+
475
+ <span class='type'>(<tt>Boolean</tt>)</span>
476
+
477
+
478
+
479
+
480
+ </li>
481
+
482
+ </ul>
483
+
484
+ </div><table class="source_code">
485
+ <tr>
486
+ <td>
487
+ <pre class="lines">
488
+
489
+
490
+ 390
491
+ 391
492
+ 392</pre>
493
+ </td>
494
+ <td>
495
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 390</span>
496
+
497
+ <span class='def def kw'>def</span> <span class='controlField? fid id'>controlField?</span>
498
+ <span class='return return kw'>return</span> <span class='false false kw'>false</span>
374
499
  <span class='end end kw'>end</span>
375
500
  </pre>
376
501
  </td>
@@ -402,14 +527,14 @@ Iterate over the subfields
402
527
  <pre class="lines">
403
528
 
404
529
 
405
- 345
406
- 346
407
- 347
408
- 348
409
- 349</pre>
530
+ 482
531
+ 483
532
+ 484
533
+ 485
534
+ 486</pre>
410
535
  </td>
411
536
  <td>
412
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 345</span>
537
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 482</span>
413
538
 
414
539
  <span class='def def kw'>def</span> <span class='each identifier id'>each</span>
415
540
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='getSubfields identifier id'>getSubfields</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='s identifier id'>s</span><span class='bitor op'>|</span>
@@ -446,12 +571,12 @@ Get first indicator as a one-character string
446
571
  <pre class="lines">
447
572
 
448
573
 
449
- 335
450
- 336
451
- 337</pre>
574
+ 472
575
+ 473
576
+ 474</pre>
452
577
  </td>
453
578
  <td>
454
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 335</span>
579
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 472</span>
455
580
 
456
581
  <span class='def def kw'>def</span> <span class='indicator1 identifier id'>indicator1</span>
457
582
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='getIndicator1 identifier id'>getIndicator1</span><span class='dot token'>.</span><span class='chr identifier id'>chr</span>
@@ -486,12 +611,12 @@ Get second indicator as a one-character string
486
611
  <pre class="lines">
487
612
 
488
613
 
489
- 340
490
- 341
491
- 342</pre>
614
+ 477
615
+ 478
616
+ 479</pre>
492
617
  </td>
493
618
  <td>
494
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 340</span>
619
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 477</span>
495
620
 
496
621
  <span class='def def kw'>def</span> <span class='indicator2 identifier id'>indicator2</span>
497
622
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='getIndicator2 identifier id'>getIndicator2</span><span class='dot token'>.</span><span class='chr identifier id'>chr</span>
@@ -610,24 +735,52 @@ order they appear in the field.
610
735
  <pre class="lines">
611
736
 
612
737
 
613
- 321
614
- 322
615
- 323
616
- 324
617
- 325
618
- 326
619
- 327
620
- 328
621
- 329
622
- 330
623
- 331
624
- 332</pre>
738
+ 444
739
+ 445
740
+ 446
741
+ 447
742
+ 448
743
+ 449
744
+ 450
745
+ 451
746
+ 452
747
+ 453
748
+ 454
749
+ 455
750
+ 456
751
+ 457
752
+ 458
753
+ 459
754
+ 460
755
+ 461
756
+ 462
757
+ 463
758
+ 464
759
+ 465
760
+ 466
761
+ 467
762
+ 468
763
+ 469</pre>
625
764
  </td>
626
765
  <td>
627
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 321</span>
766
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 444</span>
628
767
 
629
768
  <span class='def def kw'>def</span> <span class='sub_values identifier id'>sub_values</span><span class='lparen token'>(</span><span class='code identifier id'>code</span><span class='comma token'>,</span> <span class='myorder identifier id'>myorder</span> <span class='assign token'>=</span> <span class='false false kw'>false</span><span class='rparen token'>)</span>
630
- <span class='code identifier id'>code</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='code identifier id'>code</span><span class='rbrack token'>]</span> <span class='unless unless_mod kw'>unless</span> <span class='code identifier id'>code</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span> <span class='Array constant id'>Array</span>
769
+
770
+ <span class='comment val'># Do a little razzle-dazzle for the common case when a single code is given</span>
771
+ <span class='if if kw'>if</span> <span class='not not kw'>not</span> <span class='lbrack token'>[</span><span class='Set constant id'>Set</span><span class='comma token'>,</span> <span class='Array constant id'>Array</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='include? fid id'>include?</span> <span class='code identifier id'>code</span><span class='dot token'>.</span><span class='class identifier id'>class</span>
772
+ <span class='c identifier id'>c</span> <span class='assign token'>=</span> <span class='code identifier id'>code</span>
773
+ <span class='elsif elsif kw'>elsif</span> <span class='code identifier id'>code</span><span class='dot token'>.</span><span class='size identifier id'>size</span> <span class='eq op'>==</span> <span class='integer val'>1</span>
774
+ <span class='c identifier id'>c</span> <span class='assign token'>=</span> <span class='code identifier id'>code</span><span class='dot token'>.</span><span class='first identifier id'>first</span>
775
+ <span class='end end kw'>end</span>
776
+ <span class='if if kw'>if</span> <span class='c identifier id'>c</span>
777
+ <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='find_all identifier id'>find_all</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='s identifier id'>s</span><span class='bitor op'>|</span> <span class='c identifier id'>c</span> <span class='eq op'>==</span> <span class='s identifier id'>s</span><span class='dot token'>.</span><span class='code identifier id'>code</span><span class='rbrace token'>}</span><span class='dot token'>.</span><span class='map identifier id'>map</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='s identifier id'>s</span><span class='bitor op'>|</span> <span class='s identifier id'>s</span><span class='dot token'>.</span><span class='data identifier id'>data</span><span class='rbrace token'>}</span>
778
+ <span class='end end kw'>end</span>
779
+
780
+ <span class='comment val'># unless [Set, Array].include? code.class</span>
781
+ <span class='comment val'># code = [code] </span>
782
+ <span class='comment val'># # puts &quot;Arrayified for code #{code} / #{code.class}&quot;</span>
783
+ <span class='comment val'># end</span>
631
784
  <span class='if if kw'>if</span> <span class='myorder identifier id'>myorder</span>
632
785
  <span class='subs identifier id'>subs</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
633
786
  <span class='code identifier id'>code</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='c identifier id'>c</span><span class='bitor op'>|</span>
@@ -708,16 +861,16 @@ pretty string
708
861
  <pre class="lines">
709
862
 
710
863
 
711
- 285
712
- 286
713
- 287
714
- 288
715
- 289
716
- 290
717
- 291</pre>
864
+ 404
865
+ 405
866
+ 406
867
+ 407
868
+ 408
869
+ 409
870
+ 410</pre>
718
871
  </td>
719
872
  <td>
720
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 285</span>
873
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 404</span>
721
874
 
722
875
  <span class='def def kw'>def</span> <span class='to_s identifier id'>to_s</span> <span class='lparen token'>(</span><span class='joiner identifier id'>joiner</span> <span class='assign token'>=</span> <span class='string val'>' '</span><span class='rparen token'>)</span>
723
876
  <span class='arr identifier id'>arr</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='tag identifier id'>tag</span> <span class='plus op'>+</span> <span class='string val'>' '</span> <span class='plus op'>+</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='indicator1 identifier id'>indicator1</span> <span class='plus op'>+</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='indicator2 identifier id'>indicator2</span><span class='rbrack token'>]</span>
@@ -780,13 +933,13 @@ The string used to join the subfield values
780
933
  <pre class="lines">
781
934
 
782
935
 
783
- 353
784
- 354
785
- 355
786
- 356</pre>
936
+ 490
937
+ 491
938
+ 492
939
+ 493</pre>
787
940
  </td>
788
941
  <td>
789
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 353</span>
942
+ <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 490</span>
790
943
 
791
944
  <span class='def def kw'>def</span> <span class='value identifier id'>value</span> <span class='joiner identifier id'>joiner</span><span class='assign token'>=</span><span class='string val'>' '</span>
792
945
  <span class='data identifier id'>data</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='getSubfields identifier id'>getSubfields</span><span class='dot token'>.</span><span class='map identifier id'>map</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='s identifier id'>s</span><span class='bitor op'>|</span> <span class='s identifier id'>s</span><span class='dot token'>.</span><span class='data identifier id'>data</span><span class='rbrace token'>}</span>
@@ -796,69 +949,6 @@ The string used to join the subfield values
796
949
  </td>
797
950
  </tr>
798
951
  </table>
799
- </div>
800
-
801
- <div class="method_details ">
802
- <p class="signature " id="via_tagspec-instance_method">
803
-
804
- - (<tt>Object</tt>) <strong>via_tagspec</strong>(tagspec)
805
-
806
-
807
-
808
- </p><table class="source_code">
809
- <tr>
810
- <td>
811
- <pre class="lines">
812
-
813
-
814
- 260
815
- 261
816
- 262
817
- 263
818
- 264
819
- 265
820
- 266
821
- 267
822
- 268
823
- 269
824
- 270
825
- 271
826
- 272
827
- 273
828
- 274
829
- 275
830
- 276
831
- 277
832
- 278
833
- 279</pre>
834
- </td>
835
- <td>
836
- <pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 260</span>
837
-
838
- <span class='def def kw'>def</span> <span class='via_tagspec identifier id'>via_tagspec</span> <span class='lparen token'>(</span><span class='tagspec identifier id'>tagspec</span><span class='rparen token'>)</span>
839
- <span class='if if kw'>if</span> <span class='lparen token'>(</span><span class='tagspec identifier id'>tagspec</span><span class='dot token'>.</span><span class='_subs identifier id'>_subs</span> <span class='eq op'>==</span> <span class='nil nil kw'>nil</span><span class='rparen token'>)</span> <span class='or or kw'>or</span> <span class='lparen token'>(</span><span class='tagspec identifier id'>tagspec</span><span class='dot token'>.</span><span class='_subs identifier id'>_subs</span><span class='dot token'>.</span><span class='length identifier id'>length</span> <span class='eq op'>==</span> <span class='integer val'>0</span><span class='rparen token'>)</span>
840
- <span class='if if kw'>if</span> <span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='value identifier id'>value</span><span class='dot token'>.</span><span class='length identifier id'>length</span> <span class='gt op'>&gt;</span> <span class='integer val'>0</span><span class='rparen token'>)</span>
841
- <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='value identifier id'>value</span><span class='lparen token'>(</span><span class='tagspec identifier id'>tagspec</span><span class='dot token'>.</span><span class='joiner identifier id'>joiner</span><span class='rparen token'>)</span>
842
- <span class='else else kw'>else</span>
843
- <span class='return return kw'>return</span> <span class='nil nil kw'>nil</span>
844
- <span class='end end kw'>end</span>
845
- <span class='else else kw'>else</span>
846
- <span class='str identifier id'>str</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
847
- <span class='comment val'># str = &quot;&quot;</span>
848
- <span class='self self kw'>self</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='s identifier id'>s</span><span class='bitor op'>|</span>
849
- <span class='if if kw'>if</span> <span class='tagspec identifier id'>tagspec</span><span class='dot token'>.</span><span class='_subs identifier id'>_subs</span><span class='lbrack token'>[</span><span class='s identifier id'>s</span><span class='dot token'>.</span><span class='getCode identifier id'>getCode</span><span class='rbrack token'>]</span>
850
- <span class='str identifier id'>str</span><span class='dot token'>.</span><span class='push identifier id'>push</span> <span class='s identifier id'>s</span><span class='dot token'>.</span><span class='data identifier id'>data</span> <span class='if if_mod kw'>if</span> <span class='s identifier id'>s</span><span class='dot token'>.</span><span class='data identifier id'>data</span><span class='dot token'>.</span><span class='length identifier id'>length</span> <span class='gt op'>&gt;</span> <span class='integer val'>0</span>
851
- <span class='comment val'># str &lt;&lt; tagspec.joiner &lt;&lt; s.data</span>
852
- <span class='end end kw'>end</span>
853
- <span class='end end kw'>end</span>
854
- <span class='return return kw'>return</span> <span class='str identifier id'>str</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='tagspec identifier id'>tagspec</span><span class='dot token'>.</span><span class='joiner identifier id'>joiner</span><span class='rparen token'>)</span>
855
- <span class='comment val'># return str</span>
856
- <span class='end end kw'>end</span>
857
- <span class='end end kw'>end</span>
858
- </pre>
859
- </td>
860
- </tr>
861
- </table>
862
952
  </div>
863
953
 
864
954
  </div>
@@ -866,7 +956,7 @@ The string used to join the subfield values
866
956
  </div>
867
957
 
868
958
  <div id="footer">
869
- Generated on Fri Feb 12 16:38:06 2010 by
959
+ Generated on Sat Apr 3 22:01:07 2010 by
870
960
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
871
961
  0.5.3 (ruby-1.8.7).
872
962
  </div>