Class: Evergreen::BibRecord
- Includes:
- Mixins::AnonymousPcrud
- Defined in:
- lib/evergreen/bib_record.rb
Overview
A bibliographic record (title)
Instance Method Summary collapse
-
#holdings ⇒ Object
rubocop:enable Naming/MemoizedInstanceVariableName.
-
#initialize(id:, configuration:, idl:) ⇒ BibRecord
constructor
A new instance of BibRecord.
- #tcn ⇒ Object
-
#to_marc ⇒ Object
rubocop:disable Naming/MemoizedInstanceVariableName.
Methods included from Mixins::AnonymousPcrud
Methods inherited from IDLObject
Constructor Details
#initialize(id:, configuration:, idl:) ⇒ BibRecord
Returns a new instance of BibRecord.
10 11 12 13 14 |
# File 'lib/evergreen/bib_record.rb', line 10 def initialize(id:, configuration:, idl:) @id = id @configuration = configuration super(idl) end |
Instance Method Details
#holdings ⇒ Object
rubocop:enable Naming/MemoizedInstanceVariableName
22 23 24 25 26 27 28 29 |
# File 'lib/evergreen/bib_record.rb', line 22 def holdings payload = OpenSRF::ClassAndData.new(klass: 'osrfMessage', data: { 'method' => 'open-ils.cat.asset.copy_tree.global.retrieve', 'params' => ['', @id.to_s] }).to_h OpenSRF::HTTPTranslatorRequest.new(payload: payload, configuration: @configuration, service: 'open-ils.cat').response end |
#tcn ⇒ Object
31 32 33 |
# File 'lib/evergreen/bib_record.rb', line 31 def tcn get 'tcn_value' end |
#to_marc ⇒ Object
rubocop:disable Naming/MemoizedInstanceVariableName
17 18 19 |
# File 'lib/evergreen/bib_record.rb', line 17 def to_marc @marc ||= MARC::XMLReader.new(StringIO.new(get('marc'))).first end |