marc4j4r 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/doc/ControlFieldImpl.html +68 -9
- data/doc/DataFieldImpl.html +132 -55
- data/doc/Java/OrgMarc4j/MarcReader.html +4 -4
- data/doc/MARC4J4R.html +7 -5
- data/doc/RecordImpl.html +29 -33
- data/doc/SubfieldImpl.html +13 -13
- data/doc/_index.html +1 -1
- data/doc/file.README.html +4 -5
- data/doc/index.html +4 -5
- data/doc/method_list.html +35 -19
- data/doc/top-level-namespace.html +1 -1
- data/lib/marc4j4r.rb +22 -8
- metadata +68 -68
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/doc/ControlFieldImpl.html
CHANGED
@@ -122,6 +122,26 @@ Pretty-print.
|
|
122
122
|
|
123
123
|
|
124
124
|
|
125
|
+
<span class="summary_desc"></span>
|
126
|
+
|
127
|
+
</li>
|
128
|
+
|
129
|
+
|
130
|
+
<li class="public ">
|
131
|
+
<span class="summary_signature">
|
132
|
+
|
133
|
+
<a href="#via_tagspec-instance_method" title="#via_tagspec (instance method)">- (Object) <strong>via_tagspec</strong>(tagspec) </a>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
</span>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
125
145
|
<span class="summary_desc"></span>
|
126
146
|
|
127
147
|
</li>
|
@@ -196,12 +216,12 @@ pretty string
|
|
196
216
|
<pre class="lines">
|
197
217
|
|
198
218
|
|
199
|
-
|
200
|
-
|
201
|
-
|
219
|
+
251
|
220
|
+
252
|
221
|
+
253</pre>
|
202
222
|
</td>
|
203
223
|
<td>
|
204
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
224
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 251</span>
|
205
225
|
|
206
226
|
<span class='def def kw'>def</span> <span class='to_s identifier id'>to_s</span>
|
207
227
|
<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'>" "</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>
|
@@ -225,12 +245,12 @@ pretty string
|
|
225
245
|
<pre class="lines">
|
226
246
|
|
227
247
|
|
228
|
-
|
229
|
-
|
230
|
-
|
248
|
+
234
|
249
|
+
235
|
250
|
+
236</pre>
|
231
251
|
</td>
|
232
252
|
<td>
|
233
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
253
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 234</span>
|
234
254
|
|
235
255
|
<span class='def def kw'>def</span> <span class='value identifier id'>value</span>
|
236
256
|
<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>
|
@@ -239,6 +259,45 @@ pretty string
|
|
239
259
|
</td>
|
240
260
|
</tr>
|
241
261
|
</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>
|
242
301
|
</div>
|
243
302
|
|
244
303
|
</div>
|
@@ -246,7 +305,7 @@ pretty string
|
|
246
305
|
</div>
|
247
306
|
|
248
307
|
<div id="footer">
|
249
|
-
Generated on
|
308
|
+
Generated on Fri Feb 12 16:38:06 2010 by
|
250
309
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
251
310
|
0.5.3 (ruby-1.8.7).
|
252
311
|
</div>
|
data/doc/DataFieldImpl.html
CHANGED
@@ -248,6 +248,26 @@ field.
|
|
248
248
|
|
249
249
|
</span>
|
250
250
|
|
251
|
+
</li>
|
252
|
+
|
253
|
+
|
254
|
+
<li class="public ">
|
255
|
+
<span class="summary_signature">
|
256
|
+
|
257
|
+
<a href="#via_tagspec-instance_method" title="#via_tagspec (instance method)">- (Object) <strong>via_tagspec</strong>(tagspec) </a>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
</span>
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
<span class="summary_desc"></span>
|
270
|
+
|
251
271
|
</li>
|
252
272
|
|
253
273
|
|
@@ -336,15 +356,15 @@ The value of the first matched subfield
|
|
336
356
|
<pre class="lines">
|
337
357
|
|
338
358
|
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
359
|
+
296
|
360
|
+
297
|
361
|
+
298
|
362
|
+
299
|
363
|
+
300
|
364
|
+
301</pre>
|
345
365
|
</td>
|
346
366
|
<td>
|
347
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
367
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 296</span>
|
348
368
|
|
349
369
|
<span class='def def kw'>def</span> <span class='aref op'>[]</span> <span class='code identifier id'>code</span>
|
350
370
|
<span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='dstring node'>"Code must be a one-character string, not #{code}"</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>
|
@@ -382,14 +402,14 @@ Iterate over the subfields
|
|
382
402
|
<pre class="lines">
|
383
403
|
|
384
404
|
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
405
|
+
345
|
406
|
+
346
|
407
|
+
347
|
408
|
+
348
|
409
|
+
349</pre>
|
390
410
|
</td>
|
391
411
|
<td>
|
392
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
412
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 345</span>
|
393
413
|
|
394
414
|
<span class='def def kw'>def</span> <span class='each identifier id'>each</span>
|
395
415
|
<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>
|
@@ -426,12 +446,12 @@ Get first indicator as a one-character string
|
|
426
446
|
<pre class="lines">
|
427
447
|
|
428
448
|
|
429
|
-
|
430
|
-
|
431
|
-
|
449
|
+
335
|
450
|
+
336
|
451
|
+
337</pre>
|
432
452
|
</td>
|
433
453
|
<td>
|
434
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
454
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 335</span>
|
435
455
|
|
436
456
|
<span class='def def kw'>def</span> <span class='indicator1 identifier id'>indicator1</span>
|
437
457
|
<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>
|
@@ -466,12 +486,12 @@ Get second indicator as a one-character string
|
|
466
486
|
<pre class="lines">
|
467
487
|
|
468
488
|
|
469
|
-
|
470
|
-
|
471
|
-
|
489
|
+
340
|
490
|
+
341
|
491
|
+
342</pre>
|
472
492
|
</td>
|
473
493
|
<td>
|
474
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
494
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 340</span>
|
475
495
|
|
476
496
|
<span class='def def kw'>def</span> <span class='indicator2 identifier id'>indicator2</span>
|
477
497
|
<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>
|
@@ -590,30 +610,24 @@ order they appear in the field.
|
|
590
610
|
<pre class="lines">
|
591
611
|
|
592
612
|
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
304
|
606
|
-
305
|
607
|
-
306</pre>
|
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>
|
608
625
|
</td>
|
609
626
|
<td>
|
610
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
627
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 321</span>
|
611
628
|
|
612
629
|
<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>
|
613
|
-
<span class='
|
614
|
-
<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>
|
615
|
-
<span class='comment val'># puts "Arrayified for code #{code} / #{code.class}"</span>
|
616
|
-
<span class='end end kw'>end</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>
|
617
631
|
<span class='if if kw'>if</span> <span class='myorder identifier id'>myorder</span>
|
618
632
|
<span class='subs identifier id'>subs</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
|
619
633
|
<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>
|
@@ -694,16 +708,16 @@ pretty string
|
|
694
708
|
<pre class="lines">
|
695
709
|
|
696
710
|
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
711
|
+
285
|
712
|
+
286
|
713
|
+
287
|
714
|
+
288
|
715
|
+
289
|
716
|
+
290
|
717
|
+
291</pre>
|
704
718
|
</td>
|
705
719
|
<td>
|
706
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
720
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 285</span>
|
707
721
|
|
708
722
|
<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>
|
709
723
|
<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>
|
@@ -766,13 +780,13 @@ The string used to join the subfield values
|
|
766
780
|
<pre class="lines">
|
767
781
|
|
768
782
|
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
783
|
+
353
|
784
|
+
354
|
785
|
+
355
|
786
|
+
356</pre>
|
773
787
|
</td>
|
774
788
|
<td>
|
775
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
789
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 353</span>
|
776
790
|
|
777
791
|
<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>
|
778
792
|
<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>
|
@@ -782,6 +796,69 @@ The string used to join the subfield values
|
|
782
796
|
</td>
|
783
797
|
</tr>
|
784
798
|
</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'>></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 = ""</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'>></span> <span class='integer val'>0</span>
|
851
|
+
<span class='comment val'># str << tagspec.joiner << 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>
|
785
862
|
</div>
|
786
863
|
|
787
864
|
</div>
|
@@ -789,7 +866,7 @@ The string used to join the subfield values
|
|
789
866
|
</div>
|
790
867
|
|
791
868
|
<div id="footer">
|
792
|
-
Generated on
|
869
|
+
Generated on Fri Feb 12 16:38:06 2010 by
|
793
870
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
794
871
|
0.5.3 (ruby-1.8.7).
|
795
872
|
</div>
|
@@ -146,16 +146,16 @@ Return the next record, after calling #hashify on it
|
|
146
146
|
<pre class="lines">
|
147
147
|
|
148
148
|
|
149
|
+
104
|
149
150
|
105
|
150
151
|
106
|
151
152
|
107
|
152
153
|
108
|
153
154
|
109
|
154
|
-
110
|
155
|
-
111</pre>
|
155
|
+
110</pre>
|
156
156
|
</td>
|
157
157
|
<td>
|
158
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
158
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 104</span>
|
159
159
|
|
160
160
|
<span class='def def kw'>def</span> <span class='each identifier id'>each</span>
|
161
161
|
<span class='while while kw'>while</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='hasNext identifier id'>hasNext</span>
|
@@ -175,7 +175,7 @@ Return the next record, after calling #hashify on it
|
|
175
175
|
</div>
|
176
176
|
|
177
177
|
<div id="footer">
|
178
|
-
Generated on
|
178
|
+
Generated on Fri Feb 12 16:38:06 2010 by
|
179
179
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
180
180
|
0.5.3 (ruby-1.8.7).
|
181
181
|
</div>
|
data/doc/MARC4J4R.html
CHANGED
@@ -69,7 +69,9 @@
|
|
69
69
|
|
70
70
|
<dt id="NEWINIT-constant" class="">NEWINIT =
|
71
71
|
<span class="summary_desc">
|
72
|
-
|
72
|
+
A string used to override the initializer for each stream reader Need to do
|
73
|
+
it this ugly way because of the way java and ruby interact; can’t
|
74
|
+
just add it to the MarcReader interface the way I wanted to.
|
73
75
|
|
74
76
|
</span>
|
75
77
|
</dt>
|
@@ -231,6 +233,7 @@ A MarcReader object with the syntactic sugar added in this file (e.g, each)
|
|
231
233
|
<pre class="lines">
|
232
234
|
|
233
235
|
|
236
|
+
76
|
234
237
|
77
|
235
238
|
78
|
236
239
|
79
|
@@ -241,11 +244,10 @@ A MarcReader object with the syntactic sugar added in this file (e.g, each)
|
|
241
244
|
84
|
242
245
|
85
|
243
246
|
86
|
244
|
-
87
|
245
|
-
88</pre>
|
247
|
+
87</pre>
|
246
248
|
</td>
|
247
249
|
<td>
|
248
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
250
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 76</span>
|
249
251
|
|
250
252
|
<span class='def def kw'>def</span> <span class='reader identifier id'>reader</span><span class='lparen token'>(</span><span class='input identifier id'>input</span><span class='comma token'>,</span> <span class='type identifier id'>type</span> <span class='assign token'>=</span> <span class='symbol val'>:strictmarc</span><span class='rparen token'>)</span>
|
251
253
|
<span class='case case kw'>case</span> <span class='type identifier id'>type</span>
|
@@ -270,7 +272,7 @@ A MarcReader object with the syntactic sugar added in this file (e.g, each)
|
|
270
272
|
</div>
|
271
273
|
|
272
274
|
<div id="footer">
|
273
|
-
Generated on
|
275
|
+
Generated on Fri Feb 12 16:38:06 2010 by
|
274
276
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
275
277
|
0.5.3 (ruby-1.8.7).
|
276
278
|
</div>
|
data/doc/RecordImpl.html
CHANGED
@@ -349,16 +349,16 @@ this returns a single field
|
|
349
349
|
<pre class="lines">
|
350
350
|
|
351
351
|
|
352
|
+
163
|
353
|
+
164
|
352
354
|
165
|
353
355
|
166
|
354
356
|
167
|
355
357
|
168
|
356
|
-
169
|
357
|
-
170
|
358
|
-
171</pre>
|
358
|
+
169</pre>
|
359
359
|
</td>
|
360
360
|
<td>
|
361
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
361
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 163</span>
|
362
362
|
|
363
363
|
<span class='def def kw'>def</span> <span class='aref op'>[]</span> <span class='tag identifier id'>tag</span>
|
364
364
|
<span class='if if kw'>if</span> <span class='defined? defined kw'>defined?</span> <span class='@hashedtags ivar id'>@hashedtags</span>
|
@@ -397,14 +397,14 @@ Cycle through the fields in the order the appear in the record
|
|
397
397
|
<pre class="lines">
|
398
398
|
|
399
399
|
|
400
|
+
152
|
401
|
+
153
|
400
402
|
154
|
401
403
|
155
|
402
|
-
156
|
403
|
-
157
|
404
|
-
158</pre>
|
404
|
+
156</pre>
|
405
405
|
</td>
|
406
406
|
<td>
|
407
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
407
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 152</span>
|
408
408
|
|
409
409
|
<span class='def def kw'>def</span> <span class='each identifier id'>each</span>
|
410
410
|
<span class='self self kw'>self</span><span class='dot token'>.</span><span class='getVariableFields identifier id'>getVariableFields</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='f identifier id'>f</span><span class='bitor op'>|</span>
|
@@ -430,6 +430,8 @@ Cycle through the fields in the order the appear in the record
|
|
430
430
|
<pre class="lines">
|
431
431
|
|
432
432
|
|
433
|
+
205
|
434
|
+
206
|
433
435
|
207
|
434
436
|
208
|
435
437
|
209
|
@@ -440,13 +442,10 @@ Cycle through the fields in the order the appear in the record
|
|
440
442
|
214
|
441
443
|
215
|
442
444
|
216
|
443
|
-
217
|
444
|
-
218
|
445
|
-
219
|
446
|
-
220</pre>
|
445
|
+
217</pre>
|
447
446
|
</td>
|
448
447
|
<td>
|
449
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
448
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 205</span>
|
450
449
|
|
451
450
|
<span class='def def kw'>def</span> <span class='find_by_tag identifier id'>find_by_tag</span><span class='lparen token'>(</span><span class='tags identifier id'>tags</span><span class='comma token'>,</span> <span class='originalorder identifier id'>originalorder</span> <span class='assign token'>=</span> <span class='false false kw'>false</span><span class='rparen token'>)</span>
|
452
451
|
<span class='if if kw'>if</span> <span class='notop op'>!</span><span class='tags identifier id'>tags</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span> <span class='Array constant id'>Array</span>
|
@@ -458,7 +457,6 @@ Cycle through the fields in the order the appear in the record
|
|
458
457
|
<span class='if if kw'>if</span> <span class='originalorder identifier id'>originalorder</span>
|
459
458
|
<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='f identifier id'>f</span><span class='bitor op'>|</span> <span class='tags identifier id'>tags</span><span class='dot token'>.</span><span class='include? fid id'>include?</span> <span class='f identifier id'>f</span><span class='dot token'>.</span><span class='tag identifier id'>tag</span><span class='rbrace token'>}</span>
|
460
459
|
<span class='else else kw'>else</span>
|
461
|
-
<span class='comment val'># puts "Tags is #{tags}: got #{@hashedtags.values_at(*tags)}"</span>
|
462
460
|
<span class='return return kw'>return</span> <span class='@hashedtags ivar id'>@hashedtags</span><span class='dot token'>.</span><span class='values_at identifier id'>values_at</span><span class='lparen token'>(</span><span class='mult op'>*</span><span class='tags identifier id'>tags</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='flatten identifier id'>flatten</span><span class='dot token'>.</span><span class='compact identifier id'>compact</span>
|
463
461
|
<span class='end end kw'>end</span>
|
464
462
|
<span class='end end kw'>end</span>
|
@@ -493,20 +491,18 @@ automatically if you use reader.each
|
|
493
491
|
<pre class="lines">
|
494
492
|
|
495
493
|
|
494
|
+
129
|
496
495
|
130
|
497
496
|
131
|
498
497
|
132
|
499
498
|
133
|
500
499
|
134
|
501
|
-
135
|
502
|
-
136
|
503
|
-
137</pre>
|
500
|
+
135</pre>
|
504
501
|
</td>
|
505
502
|
<td>
|
506
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
503
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 129</span>
|
507
504
|
|
508
505
|
<span class='def def kw'>def</span> <span class='hashify identifier id'>hashify</span>
|
509
|
-
<span class='return return kw'>return</span> <span class='if if_mod kw'>if</span> <span class='@hashedtags ivar id'>@hashedtags</span> <span class='comment val'># don't do it more than once</span>
|
510
506
|
<span class='@hashedtags ivar id'>@hashedtags</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
|
511
507
|
<span class='self self kw'>self</span><span class='dot token'>.</span><span class='getVariableFields identifier id'>getVariableFields</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='f identifier id'>f</span><span class='bitor op'>|</span>
|
512
508
|
<span class='@hashedtags ivar id'>@hashedtags</span><span class='lbrack token'>[</span><span class='f identifier id'>f</span><span class='dot token'>.</span><span class='tag identifier id'>tag</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
|
@@ -543,12 +539,12 @@ Get the leader as a string (marc4j would otherwise return Leader object)
|
|
543
539
|
<pre class="lines">
|
544
540
|
|
545
541
|
|
546
|
-
|
547
|
-
|
548
|
-
|
542
|
+
147
|
543
|
+
148
|
544
|
+
149</pre>
|
549
545
|
</td>
|
550
546
|
<td>
|
551
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
547
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 147</span>
|
552
548
|
|
553
549
|
<span class='def def kw'>def</span> <span class='leader identifier id'>leader</span>
|
554
550
|
<span class='self self kw'>self</span><span class='dot token'>.</span><span class='get_leader identifier id'>get_leader</span><span class='dot token'>.</span><span class='toString identifier id'>toString</span>
|
@@ -583,16 +579,16 @@ Create a nice string of the record
|
|
583
579
|
<pre class="lines">
|
584
580
|
|
585
581
|
|
582
|
+
138
|
583
|
+
139
|
586
584
|
140
|
587
585
|
141
|
588
586
|
142
|
589
587
|
143
|
590
|
-
144
|
591
|
-
145
|
592
|
-
146</pre>
|
588
|
+
144</pre>
|
593
589
|
</td>
|
594
590
|
<td>
|
595
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
591
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 138</span>
|
596
592
|
|
597
593
|
<span class='def def kw'>def</span> <span class='to_s identifier id'>to_s</span>
|
598
594
|
<span class='arr identifier id'>arr</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='string val'>'LEADER '</span> <span class='plus op'>+</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='leader identifier id'>leader</span><span class='rbrack token'>]</span>
|
@@ -650,17 +646,17 @@ String A MARC-XML representation of the record, including the XML header
|
|
650
646
|
<pre class="lines">
|
651
647
|
|
652
648
|
|
649
|
+
222
|
650
|
+
223
|
651
|
+
224
|
653
652
|
225
|
654
653
|
226
|
655
654
|
227
|
656
655
|
228
|
657
|
-
229
|
658
|
-
230
|
659
|
-
231
|
660
|
-
232</pre>
|
656
|
+
229</pre>
|
661
657
|
</td>
|
662
658
|
<td>
|
663
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
659
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 222</span>
|
664
660
|
|
665
661
|
<span class='def def kw'>def</span> <span class='to_xml identifier id'>to_xml</span>
|
666
662
|
<span class='return return kw'>return</span> <span class='@xml ivar id'>@xml</span> <span class='if if_mod kw'>if</span> <span class='@xml ivar id'>@xml</span>
|
@@ -681,7 +677,7 @@ String A MARC-XML representation of the record, including the XML header
|
|
681
677
|
</div>
|
682
678
|
|
683
679
|
<div id="footer">
|
684
|
-
Generated on
|
680
|
+
Generated on Fri Feb 12 16:38:06 2010 by
|
685
681
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
686
682
|
0.5.3 (ruby-1.8.7).
|
687
683
|
</div>
|
data/doc/SubfieldImpl.html
CHANGED
@@ -164,12 +164,12 @@
|
|
164
164
|
<pre class="lines">
|
165
165
|
|
166
166
|
|
167
|
-
|
168
|
-
|
169
|
-
|
167
|
+
365
|
168
|
+
366
|
169
|
+
367</pre>
|
170
170
|
</td>
|
171
171
|
<td>
|
172
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
172
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 365</span>
|
173
173
|
|
174
174
|
<span class='def def kw'>def</span> <span class='code identifier id'>code</span>
|
175
175
|
<span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='getCode identifier id'>getCode</span><span class='dot token'>.</span><span class='chr identifier id'>chr</span>
|
@@ -193,12 +193,12 @@
|
|
193
193
|
<pre class="lines">
|
194
194
|
|
195
195
|
|
196
|
-
|
197
|
-
|
198
|
-
|
196
|
+
369
|
197
|
+
370
|
198
|
+
371</pre>
|
199
199
|
</td>
|
200
200
|
<td>
|
201
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
201
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 369</span>
|
202
202
|
|
203
203
|
<span class='def def kw'>def</span> <span class='to_s identifier id'>to_s</span>
|
204
204
|
<span class='return return kw'>return</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='code identifier id'>code</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='data identifier id'>data</span>
|
@@ -222,12 +222,12 @@
|
|
222
222
|
<pre class="lines">
|
223
223
|
|
224
224
|
|
225
|
-
|
226
|
-
|
227
|
-
|
225
|
+
361
|
226
|
+
362
|
227
|
+
363</pre>
|
228
228
|
</td>
|
229
229
|
<td>
|
230
|
-
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line
|
230
|
+
<pre class="code"><span class="info file"># File 'lib/marc4j4r.rb', line 361</span>
|
231
231
|
|
232
232
|
<span class='def def kw'>def</span> <span class='value identifier id'>value</span>
|
233
233
|
<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>
|
@@ -243,7 +243,7 @@
|
|
243
243
|
</div>
|
244
244
|
|
245
245
|
<div id="footer">
|
246
|
-
Generated on
|
246
|
+
Generated on Fri Feb 12 16:38:07 2010 by
|
247
247
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
248
248
|
0.5.3 (ruby-1.8.7).
|
249
249
|
</div>
|
data/doc/_index.html
CHANGED
data/doc/file.README.html
CHANGED
@@ -41,13 +41,13 @@
|
|
41
41
|
|
42
42
|
<iframe id="search_frame"></iframe>
|
43
43
|
|
44
|
-
<div id="content"><div id='filecontents'><h1>marc4j4r
|
44
|
+
<div id="content"><div id='filecontents'><h1>marc4j4r</h1>
|
45
45
|
|
46
46
|
<p>marc4j4r is some simple syntactic sugar on top of the java libary <a href="http://marc4j.tigris.org/">marc4j</a>. It allows iteration
|
47
47
|
via #each and implements many of the same convenience functions as <a href="http://marc.rubyforge.org/">ruby-marc</a>.</p>
|
48
48
|
|
49
49
|
<p>Most of the good stuff is in RecordImpl and DataFieldImpl. They, along with the *Reader classes, now implement #each
|
50
|
-
for their subparts as well as #[] where it makes sense. See the examples in
|
50
|
+
for their subparts as well as #[] where it makes sense. See the examples in the documentation for more information.</p>
|
51
51
|
|
52
52
|
<p>There's also a convenience module method, MARC4J4R.reader, to get a reader, as shown below.</p>
|
53
53
|
|
@@ -78,11 +78,10 @@ for their subparts as well as #[] where it makes sense. See the examples in <a h
|
|
78
78
|
|
79
79
|
<p>== Copyright</p>
|
80
80
|
|
81
|
-
<p>Copyright (c) 2010 BillDueber. See LICENSE for details.</p>
|
82
|
-
</div></div>
|
81
|
+
<p>Copyright (c) 2010 BillDueber. See LICENSE for details.</p></div></div>
|
83
82
|
|
84
83
|
<div id="footer">
|
85
|
-
Generated on
|
84
|
+
Generated on Fri Feb 12 16:38:06 2010 by
|
86
85
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
87
86
|
0.5.3 (ruby-1.8.7).
|
88
87
|
</div>
|
data/doc/index.html
CHANGED
@@ -41,13 +41,13 @@
|
|
41
41
|
|
42
42
|
<iframe id="search_frame"></iframe>
|
43
43
|
|
44
|
-
<div id="content"><div id='filecontents'><h1>marc4j4r
|
44
|
+
<div id="content"><div id='filecontents'><h1>marc4j4r</h1>
|
45
45
|
|
46
46
|
<p>marc4j4r is some simple syntactic sugar on top of the java libary <a href="http://marc4j.tigris.org/">marc4j</a>. It allows iteration
|
47
47
|
via #each and implements many of the same convenience functions as <a href="http://marc.rubyforge.org/">ruby-marc</a>.</p>
|
48
48
|
|
49
49
|
<p>Most of the good stuff is in RecordImpl and DataFieldImpl. They, along with the *Reader classes, now implement #each
|
50
|
-
for their subparts as well as #[] where it makes sense. See the examples in
|
50
|
+
for their subparts as well as #[] where it makes sense. See the examples in the documentation for more information.</p>
|
51
51
|
|
52
52
|
<p>There's also a convenience module method, MARC4J4R.reader, to get a reader, as shown below.</p>
|
53
53
|
|
@@ -78,11 +78,10 @@ for their subparts as well as #[] where it makes sense. See the examples in <a h
|
|
78
78
|
|
79
79
|
<p>== Copyright</p>
|
80
80
|
|
81
|
-
<p>Copyright (c) 2010 BillDueber. See LICENSE for details.</p>
|
82
|
-
</div></div>
|
81
|
+
<p>Copyright (c) 2010 BillDueber. See LICENSE for details.</p></div></div>
|
83
82
|
|
84
83
|
<div id="footer">
|
85
|
-
Generated on
|
84
|
+
Generated on Fri Feb 12 16:38:05 2010 by
|
86
85
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
87
86
|
0.5.3 (ruby-1.8.7).
|
88
87
|
</div>
|
data/doc/method_list.html
CHANGED
@@ -29,17 +29,17 @@
|
|
29
29
|
|
30
30
|
|
31
31
|
<li class="r1 ">
|
32
|
-
<a href="
|
32
|
+
<a href="DataFieldImpl.html#%5B%5D-instance_method" title="DataFieldImpl#[] (method)">#[]</a>
|
33
33
|
|
34
|
-
<small>
|
34
|
+
<small>DataFieldImpl</small>
|
35
35
|
|
36
36
|
</li>
|
37
37
|
|
38
38
|
|
39
39
|
<li class="r2 ">
|
40
|
-
<a href="
|
40
|
+
<a href="RecordImpl.html#%5B%5D-instance_method" title="RecordImpl#[] (method)">#[]</a>
|
41
41
|
|
42
|
-
<small>
|
42
|
+
<small>RecordImpl</small>
|
43
43
|
|
44
44
|
</li>
|
45
45
|
|
@@ -53,25 +53,25 @@
|
|
53
53
|
|
54
54
|
|
55
55
|
<li class="r2 ">
|
56
|
-
<a href="
|
56
|
+
<a href="RecordImpl.html#each-instance_method" title="RecordImpl#each (method)">#each</a>
|
57
57
|
|
58
|
-
<small>
|
58
|
+
<small>RecordImpl</small>
|
59
59
|
|
60
60
|
</li>
|
61
61
|
|
62
62
|
|
63
63
|
<li class="r1 ">
|
64
|
-
<a href="
|
64
|
+
<a href="DataFieldImpl.html#each-instance_method" title="DataFieldImpl#each (method)">#each</a>
|
65
65
|
|
66
|
-
<small>
|
66
|
+
<small>DataFieldImpl</small>
|
67
67
|
|
68
68
|
</li>
|
69
69
|
|
70
70
|
|
71
71
|
<li class="r2 ">
|
72
|
-
<a href="
|
72
|
+
<a href="Java/OrgMarc4j/MarcReader.html#each-instance_method" title="Java::OrgMarc4j::MarcReader#each (method)">#each</a>
|
73
73
|
|
74
|
-
<small>
|
74
|
+
<small>Java::OrgMarc4j::MarcReader</small>
|
75
75
|
|
76
76
|
</li>
|
77
77
|
|
@@ -133,6 +133,14 @@
|
|
133
133
|
|
134
134
|
|
135
135
|
<li class="r2 ">
|
136
|
+
<a href="DataFieldImpl.html#to_s-instance_method" title="DataFieldImpl#to_s (method)">#to_s</a>
|
137
|
+
|
138
|
+
<small>DataFieldImpl</small>
|
139
|
+
|
140
|
+
</li>
|
141
|
+
|
142
|
+
|
143
|
+
<li class="r1 ">
|
136
144
|
<a href="SubfieldImpl.html#to_s-instance_method" title="SubfieldImpl#to_s (method)">#to_s</a>
|
137
145
|
|
138
146
|
<small>SubfieldImpl</small>
|
@@ -140,7 +148,7 @@
|
|
140
148
|
</li>
|
141
149
|
|
142
150
|
|
143
|
-
<li class="
|
151
|
+
<li class="r2 ">
|
144
152
|
<a href="RecordImpl.html#to_s-instance_method" title="RecordImpl#to_s (method)">#to_s</a>
|
145
153
|
|
146
154
|
<small>RecordImpl</small>
|
@@ -148,7 +156,7 @@
|
|
148
156
|
</li>
|
149
157
|
|
150
158
|
|
151
|
-
<li class="
|
159
|
+
<li class="r1 ">
|
152
160
|
<a href="ControlFieldImpl.html#to_s-instance_method" title="ControlFieldImpl#to_s (method)">#to_s</a>
|
153
161
|
|
154
162
|
<small>ControlFieldImpl</small>
|
@@ -156,18 +164,26 @@
|
|
156
164
|
</li>
|
157
165
|
|
158
166
|
|
167
|
+
<li class="r2 ">
|
168
|
+
<a href="RecordImpl.html#to_xml-instance_method" title="RecordImpl#to_xml (method)">#to_xml</a>
|
169
|
+
|
170
|
+
<small>RecordImpl</small>
|
171
|
+
|
172
|
+
</li>
|
173
|
+
|
174
|
+
|
159
175
|
<li class="r1 ">
|
160
|
-
<a href="
|
176
|
+
<a href="ControlFieldImpl.html#value-instance_method" title="ControlFieldImpl#value (method)">#value</a>
|
161
177
|
|
162
|
-
<small>
|
178
|
+
<small>ControlFieldImpl</small>
|
163
179
|
|
164
180
|
</li>
|
165
181
|
|
166
182
|
|
167
183
|
<li class="r2 ">
|
168
|
-
<a href="
|
184
|
+
<a href="SubfieldImpl.html#value-instance_method" title="SubfieldImpl#value (method)">#value</a>
|
169
185
|
|
170
|
-
<small>
|
186
|
+
<small>SubfieldImpl</small>
|
171
187
|
|
172
188
|
</li>
|
173
189
|
|
@@ -181,15 +197,15 @@
|
|
181
197
|
|
182
198
|
|
183
199
|
<li class="r2 ">
|
184
|
-
<a href="
|
200
|
+
<a href="DataFieldImpl.html#via_tagspec-instance_method" title="DataFieldImpl#via_tagspec (method)">#via_tagspec</a>
|
185
201
|
|
186
|
-
<small>
|
202
|
+
<small>DataFieldImpl</small>
|
187
203
|
|
188
204
|
</li>
|
189
205
|
|
190
206
|
|
191
207
|
<li class="r1 ">
|
192
|
-
<a href="ControlFieldImpl.html#
|
208
|
+
<a href="ControlFieldImpl.html#via_tagspec-instance_method" title="ControlFieldImpl#via_tagspec (method)">#via_tagspec</a>
|
193
209
|
|
194
210
|
<small>ControlFieldImpl</small>
|
195
211
|
|
data/lib/marc4j4r.rb
CHANGED
@@ -195,6 +195,12 @@ class RecordImpl
|
|
195
195
|
#
|
196
196
|
# # The results are ordered first by tag as passed in, then by original order within the tag
|
197
197
|
#
|
198
|
+
# @example Just get all fields for a single tag
|
199
|
+
# ohThirtyFives = r.find_by_tag('035')
|
200
|
+
#
|
201
|
+
# @example Get a bunch of standard identifiers
|
202
|
+
# standardIDs = r.find_by_tag(['022', '020', '010'])
|
203
|
+
#
|
198
204
|
# @example originalorder == true
|
199
205
|
# r.find_by_tag(['035', '010'], true).each {|f| puts f.to_s}
|
200
206
|
# # 010 $a 68027371
|
@@ -202,13 +208,10 @@ class RecordImpl
|
|
202
208
|
# # 035 $a (CaOTULAS)159818044
|
203
209
|
# # 035 $a (OCoLC)ocm00001728
|
204
210
|
|
205
|
-
|
206
211
|
def find_by_tag(tags, originalorder = false)
|
212
|
+
self.hashify unless @hashedtags
|
207
213
|
if !tags.is_a? Array
|
208
|
-
tags
|
209
|
-
end
|
210
|
-
if (originalorder == false and @hashedtags == nil)
|
211
|
-
self.hashify
|
214
|
+
return @hashedtags[tags] || []
|
212
215
|
end
|
213
216
|
if originalorder
|
214
217
|
return self.find_all {|f| tags.include? f.tag}
|
@@ -289,10 +292,21 @@ class DataFieldImpl
|
|
289
292
|
# rec['260'].sub_values(['c', 'a'], true) #=> ["1969", "New York"]
|
290
293
|
|
291
294
|
def sub_values(code, myorder = false)
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
+
|
296
|
+
# Do a little razzle-dazzle for the common case when a single code is given
|
297
|
+
if not [Set, Array].include? code.class
|
298
|
+
c = code
|
299
|
+
elsif code.size == 1
|
300
|
+
c = code.first
|
301
|
+
end
|
302
|
+
if c
|
303
|
+
return self.find_all { |s| c == s.code}.map {|s| s.data}
|
295
304
|
end
|
305
|
+
|
306
|
+
# unless [Set, Array].include? code.class
|
307
|
+
# code = [code]
|
308
|
+
# # puts "Arrayified for code #{code} / #{code.class}"
|
309
|
+
# end
|
296
310
|
if myorder
|
297
311
|
subs = []
|
298
312
|
code.each do |c|
|
metadata
CHANGED
@@ -1,37 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marc4j4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
|
7
|
+
- BillDueber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-15 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: thoughtbot-shoulda
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: yard
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
35
|
description: Syntactic sugar and some extra methods to deal with classes in the marc4j java package
|
36
36
|
email: bill@dueber.com
|
37
37
|
executables: []
|
@@ -39,62 +39,62 @@ executables: []
|
|
39
39
|
extensions: []
|
40
40
|
|
41
41
|
extra_rdoc_files:
|
42
|
-
|
43
|
-
|
42
|
+
- LICENSE
|
43
|
+
- README.markdown
|
44
44
|
files:
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
45
|
+
- .document
|
46
|
+
- .gitignore
|
47
|
+
- LICENSE
|
48
|
+
- README.markdown
|
49
|
+
- Rakefile
|
50
|
+
- VERSION
|
51
|
+
- doc/ControlFieldImpl.html
|
52
|
+
- doc/DataFieldImpl.html
|
53
|
+
- doc/Java/OrgMarc4j/MarcReader.html
|
54
|
+
- doc/MARC4J4R.html
|
55
|
+
- doc/MARC4J4R/Reader.html
|
56
|
+
- doc/RecordImpl.html
|
57
|
+
- doc/SubfieldImpl.html
|
58
|
+
- doc/_index.html
|
59
|
+
- doc/class_list.html
|
60
|
+
- doc/css/common.css
|
61
|
+
- doc/css/full_list.css
|
62
|
+
- doc/css/style.css
|
63
|
+
- doc/file.README.html
|
64
|
+
- doc/file_list.html
|
65
|
+
- doc/frames.html
|
66
|
+
- doc/index.html
|
67
|
+
- doc/js/app.js
|
68
|
+
- doc/js/full_list.js
|
69
|
+
- doc/js/jquery.js
|
70
|
+
- doc/method_list.html
|
71
|
+
- doc/top-level-namespace.html
|
72
|
+
- jars/marc4j.jar
|
73
|
+
- lib/marc4j4r.rb
|
74
|
+
- test/helper.rb
|
75
|
+
- test/one.dat
|
76
|
+
- test/one.xml
|
77
|
+
- test/test_marc4j4r.rb
|
78
78
|
has_rdoc: true
|
79
79
|
homepage: http://github.com/billdueber/marc4j4r
|
80
80
|
licenses: []
|
81
81
|
|
82
82
|
post_install_message:
|
83
83
|
rdoc_options:
|
84
|
-
|
84
|
+
- --charset=UTF-8
|
85
85
|
require_paths:
|
86
|
-
|
86
|
+
- lib
|
87
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: "0"
|
92
92
|
version:
|
93
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: "0"
|
98
98
|
version:
|
99
99
|
requirements: []
|
100
100
|
|
@@ -104,5 +104,5 @@ signing_key:
|
|
104
104
|
specification_version: 3
|
105
105
|
summary: Use marc4j java library in JRuby in a more ruby-ish way
|
106
106
|
test_files:
|
107
|
-
|
108
|
-
|
107
|
+
- test/helper.rb
|
108
|
+
- test/test_marc4j4r.rb
|