Class: BerkeleyLibrary::AV::Record
- Inherits:
-
Object
- Object
- BerkeleyLibrary::AV::Record
- Includes:
- Util
- Defined in:
- lib/berkeley_library/av/record.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#tracks ⇒ Object
readonly
Returns the value of attribute tracks.
Class Method Summary collapse
-
.from_metadata(collection:, record_id:) ⇒ Object
Loads the metadata for the specified record and creates a record object from it.
Instance Method Summary collapse
- #bib_number ⇒ Object
- #calnet_only? ⇒ Boolean
- #calnet_or_ip? ⇒ Boolean
- #description ⇒ Object
- #display_uri ⇒ Object
-
#initialize(collection:, tracks:, metadata:) ⇒ Record
constructor
TODO: stop passing in track list & just get it from metadata & collection.
-
#player_uri ⇒ Object
TODO: is this needed?.
- #record_id ⇒ Object
- #tind_id ⇒ Object
- #title ⇒ Object
- #type_label ⇒ Object
Constructor Details
#initialize(collection:, tracks:, metadata:) ⇒ Record
TODO: stop passing in track list & just get it from metadata & collection
15 16 17 18 19 |
# File 'lib/berkeley_library/av/record.rb', line 15 def initialize(collection:, tracks:, metadata:) @collection = collection @tracks = tracks.sort @metadata = end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
12 13 14 |
# File 'lib/berkeley_library/av/record.rb', line 12 def collection @collection end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
12 13 14 |
# File 'lib/berkeley_library/av/record.rb', line 12 def @metadata end |
#tracks ⇒ Object (readonly)
Returns the value of attribute tracks.
12 13 14 |
# File 'lib/berkeley_library/av/record.rb', line 12 def tracks @tracks end |
Class Method Details
.from_metadata(collection:, record_id:) ⇒ Object
Loads the metadata for the specified record and creates a record object from it.
Note that for TIND records the record ID is not the TIND internal ID (MARC field 001) but rather the ID assigned by the UC Berkeley Library (MARC field 035).
76 77 78 79 80 81 82 83 |
# File 'lib/berkeley_library/av/record.rb', line 76 def (collection:, record_id:) = Metadata.for_record(record_id:) Record.new( collection:, metadata:, tracks: Track.tracks_from(.marc_record, collection:) ) end |
Instance Method Details
#bib_number ⇒ Object
25 26 27 |
# File 'lib/berkeley_library/av/record.rb', line 25 def bib_number .bib_number end |
#calnet_only? ⇒ Boolean
41 42 43 |
# File 'lib/berkeley_library/av/record.rb', line 41 def calnet_only? .calnet_only? end |
#calnet_or_ip? ⇒ Boolean
37 38 39 |
# File 'lib/berkeley_library/av/record.rb', line 37 def calnet_or_ip? .calnet_or_ip? end |
#description ⇒ Object
63 64 65 |
# File 'lib/berkeley_library/av/record.rb', line 63 def description .description end |
#display_uri ⇒ Object
59 60 61 |
# File 'lib/berkeley_library/av/record.rb', line 59 def display_uri .display_uri end |
#player_uri ⇒ Object
TODO: is this needed?
55 56 57 |
# File 'lib/berkeley_library/av/record.rb', line 55 def player_uri @player_uri ||= URIs.append(AV::Config.avplayer_base_uri, collection, record_id) end |
#record_id ⇒ Object
33 34 35 |
# File 'lib/berkeley_library/av/record.rb', line 33 def record_id .record_id end |
#tind_id ⇒ Object
29 30 31 |
# File 'lib/berkeley_library/av/record.rb', line 29 def tind_id .tind_id end |
#title ⇒ Object
21 22 23 |
# File 'lib/berkeley_library/av/record.rb', line 21 def title .title end |