Class: BerkeleyLibrary::Holdings::HathiTrust::RecordUrlBatchRequest
- Inherits:
-
Object
- Object
- BerkeleyLibrary::Holdings::HathiTrust::RecordUrlBatchRequest
- Includes:
- RecordUrlRequestBase
- Defined in:
- lib/berkeley_library/holdings/hathi_trust/record_url_batch_request.rb
Constant Summary collapse
- MAX_BATCH_SIZE =
Per HathiTrust API docs: www.hathitrust.org/bib_api
20
Instance Attribute Summary collapse
-
#oclc_numbers ⇒ Object
readonly
Returns the value of attribute oclc_numbers.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(oclc_numbers) ⇒ RecordUrlBatchRequest
constructor
A new instance of RecordUrlBatchRequest.
- #uri ⇒ Object
Constructor Details
#initialize(oclc_numbers) ⇒ RecordUrlBatchRequest
Returns a new instance of RecordUrlBatchRequest.
14 15 16 |
# File 'lib/berkeley_library/holdings/hathi_trust/record_url_batch_request.rb', line 14 def initialize(oclc_numbers) @oclc_numbers = ensure_valid_oclc_numbers!(oclc_numbers) end |
Instance Attribute Details
#oclc_numbers ⇒ Object (readonly)
Returns the value of attribute oclc_numbers.
12 13 14 |
# File 'lib/berkeley_library/holdings/hathi_trust/record_url_batch_request.rb', line 12 def oclc_numbers @oclc_numbers end |
Instance Method Details
#execute ⇒ Object
18 19 20 21 |
# File 'lib/berkeley_library/holdings/hathi_trust/record_url_batch_request.rb', line 18 def execute response_body = URIs.get(uri, log: false) record_urls_from(response_body) end |
#uri ⇒ Object
23 24 25 |
# File 'lib/berkeley_library/holdings/hathi_trust/record_url_batch_request.rb', line 23 def uri @uri ||= URIs.append(volumes_base_uri, 'json', URIs.path_escape(oclc_list)) end |