marc 0.1.4 → 0.1.5

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.
@@ -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)
@@ -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::Field objects.
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
 
@@ -1,4 +1,9 @@
1
1
  module MARC
2
+
3
+ # A class to represents a subfield within a DataField.
4
+ # Accessor attributes: code (letter subfield code) ; value
5
+ # Both can be empty string, but should not be nil.
6
+
2
7
 
3
8
  class Subfield
4
9
  attr_accessor :code, :value
@@ -3,7 +3,7 @@ require 'rexml/text'
3
3
 
4
4
  module MARC
5
5
 
6
- # A class for writing MARC records as MARC21.
6
+ # A class for writing MARC records as MARCXML.
7
7
 
8
8
  class XMLWriter
9
9
 
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0
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.4
7
- date: 2007-01-02 00:00:00 -05:00
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/dublincore.rb
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/subfield.rb
42
- - lib/marc/writer.rb
39
+ - lib/marc/reader.rb
43
40
  - lib/marc/xmlreader.rb
44
- - lib/marc/xmlwriter.rb
45
- - test/batch.dat
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/one.dat
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/tc_writer.rb
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: []