Class | MARC::Reader |
In: |
lib/marc/reader.rb
|
Parent: | Object |
A static method for turning raw MARC data in transission format into a MARC::Record object.
The constructor which you may pass either a path
reader = MARC::Reader.new('marc.dat')
or, if it‘s more convenient a File object:
fh = File.new('marc.dat') reader = MARC::Reader.new(fh)
or really any object that responds to read(n)
# marc is a string with a bunch of records in it reader = MARC::Reader.new(StringIO.new(reader))
If your data have non-standard control fields in them (e.g., Aleph‘s ‘FMT’) you need to add them specifically to the MARC::ControlField.control_tags Set object
MARC::ControlField.control_tags << 'FMT'