marc 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/marc/datafield.rb +11 -1
- data/lib/marc/record.rb +11 -2
- data/lib/marc/subfield.rb +5 -0
- data/lib/marc/xmlwriter.rb +1 -1
- metadata +17 -17
data/lib/marc/datafield.rb
CHANGED
@@ -6,6 +6,16 @@ module MARC
|
|
6
6
|
# MARC records contain data fields, each of which has a tag,
|
7
7
|
# indicators and subfields. Tags for data fields must be in
|
8
8
|
# the range 010-999.
|
9
|
+
# Accessor attributes: tag ; indicator1 ; indicator2
|
10
|
+
#
|
11
|
+
# DataField includes enumerable for access to it's constituent
|
12
|
+
# Subfield objects. For instance, if you have a DataField representing
|
13
|
+
# a 856 tag, and want to find all 'z' subfields:
|
14
|
+
# urltag.find_all { |subfield| subfield.code == 'z' }
|
15
|
+
#
|
16
|
+
# Also, the accessor 'subfields' is an array of MARC::Subfield objects
|
17
|
+
# which can be accessed or modified by the client directly if
|
18
|
+
# neccesary.
|
9
19
|
|
10
20
|
class DataField
|
11
21
|
include Enumerable
|
@@ -85,7 +95,7 @@ module MARC
|
|
85
95
|
|
86
96
|
|
87
97
|
# Add a subfield (MARC::Subfield) to the field
|
88
|
-
# field.append(MARC::Subfield('a','Dave Thomas'))
|
98
|
+
# field.append(MARC::Subfield.new('a','Dave Thomas'))
|
89
99
|
|
90
100
|
def append(subfield)
|
91
101
|
@subfields.push(subfield)
|
data/lib/marc/record.rb
CHANGED
@@ -1,8 +1,17 @@
|
|
1
1
|
module MARC
|
2
2
|
|
3
3
|
# A class that represents an individual MARC record. Every record
|
4
|
-
# is made up of a collection of MARC::
|
5
|
-
|
4
|
+
# is made up of a collection of MARC::DataField objects.
|
5
|
+
#
|
6
|
+
# MARC::Record includes Enumerable for access to constituent
|
7
|
+
# DataFields. Eg, to return a list of all 650 DataFields:
|
8
|
+
# record.find_all { |field| field.tag == '650' }
|
9
|
+
#
|
10
|
+
# The accessor 'fields' is also an Array of MARC::DataField objects which
|
11
|
+
# the client can access or modifyi if neccesary.
|
12
|
+
#
|
13
|
+
# Other accessor attribute: 'leader' for record leader as String
|
14
|
+
|
6
15
|
class Record
|
7
16
|
include Enumerable
|
8
17
|
|
data/lib/marc/subfield.rb
CHANGED
data/lib/marc/xmlwriter.rb
CHANGED
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: marc
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date: 2007-01
|
6
|
+
version: 0.1.5
|
7
|
+
date: 2007-05-01 00:00:00 -04:00
|
8
8
|
summary: A ruby library for working with Machine Readable Cataloging
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -30,30 +30,30 @@ authors:
|
|
30
30
|
- Ed Summers
|
31
31
|
files:
|
32
32
|
- lib/marc
|
33
|
-
- lib/marc.rb
|
34
|
-
- lib/marc/constants.rb
|
35
33
|
- lib/marc/controlfield.rb
|
36
34
|
- lib/marc/datafield.rb
|
37
|
-
- lib/marc/
|
35
|
+
- lib/marc/subfield.rb
|
36
|
+
- lib/marc/xmlwriter.rb
|
38
37
|
- lib/marc/exception.rb
|
39
|
-
- lib/marc/reader.rb
|
40
38
|
- lib/marc/record.rb
|
41
|
-
- lib/marc/
|
42
|
-
- lib/marc/writer.rb
|
39
|
+
- lib/marc/reader.rb
|
43
40
|
- lib/marc/xmlreader.rb
|
44
|
-
- lib/marc/
|
45
|
-
-
|
41
|
+
- lib/marc/dublincore.rb
|
42
|
+
- lib/marc/constants.rb
|
43
|
+
- lib/marc/writer.rb
|
44
|
+
- lib/marc.rb
|
45
|
+
- test/tc_datafield.rb
|
46
46
|
- test/batch.xml
|
47
|
-
- test/
|
47
|
+
- test/tc_writer.rb
|
48
48
|
- test/tc_controlfield.rb
|
49
|
-
- test/tc_datafield.rb
|
50
|
-
- test/tc_dublincore.rb
|
51
|
-
- test/tc_reader.rb
|
52
|
-
- test/tc_record.rb
|
53
49
|
- test/tc_subfield.rb
|
54
|
-
- test/
|
50
|
+
- test/tc_record.rb
|
51
|
+
- test/batch.dat
|
52
|
+
- test/one.dat
|
55
53
|
- test/tc_xml.rb
|
54
|
+
- test/tc_reader.rb
|
56
55
|
- test/ts_marc.rb
|
56
|
+
- test/tc_dublincore.rb
|
57
57
|
test_files:
|
58
58
|
- test/ts_marc.rb
|
59
59
|
rdoc_options: []
|