Class: Traject::UMichFormat
- Inherits:
-
Object
- Object
- Traject::UMichFormat
- Defined in:
- lib/traject/umich_format.rb,
lib/traject/umich_format/version.rb
Overview
Encapsulates logic that uses University of Michigan University Library rules to determine both bib format (book, serial, visual material, etc.) and type, a more expansive list including both format (blu-ray, microform) and more semantic categories (bibliography, conference)
Defined Under Namespace
Modules: Macros Classes: BibFormat, BibTypes, XV6XX
Constant Summary collapse
- VERSION =
"0.4.4"
Instance Attribute Summary collapse
-
#bib_format ⇒ Object
readonly
The bib format code as computed from the passed record.
-
#record ⇒ Object
readonly
The record passed into the constructor.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
- #format_and_types ⇒ Object
-
#initialize(marc_record) ⇒ UMichFormat
constructor
Construct a Formats object from the given record, calcuclating the bib_format and types.
Constructor Details
#initialize(marc_record) ⇒ UMichFormat
Construct a Formats object from the given record, calcuclating the bib_format and types
27 28 29 30 31 |
# File 'lib/traject/umich_format.rb', line 27 def initialize(marc_record) @record = marc_record @bib_format = BibFormat.new(record).code @types = BibTypes.new(@bib_format, record).codes end |
Instance Attribute Details
#bib_format ⇒ Object (readonly)
The bib format code as computed from the passed record
21 22 23 |
# File 'lib/traject/umich_format.rb', line 21 def bib_format @bib_format end |
#record ⇒ Object (readonly)
The record passed into the constructor
21 |
# File 'lib/traject/umich_format.rb', line 21 attr_reader :bib_format, :record, :types |
#types ⇒ Object (readonly)
Returns the value of attribute types.
21 |
# File 'lib/traject/umich_format.rb', line 21 attr_reader :bib_format, :record, :types |
Instance Method Details
#format_and_types ⇒ Object
33 34 35 36 37 38 |
# File 'lib/traject/umich_format.rb', line 33 def format_and_types types = @types.dup types.unshift bib_format types.uniq! types end |