Class: BerkeleyLibrary::Location::HathiTrust::RecordUrlRequest
- Inherits:
-
Object
- Object
- BerkeleyLibrary::Location::HathiTrust::RecordUrlRequest
- Includes:
- RecordUrlRequestBase
- Defined in:
- lib/berkeley_library/location/hathi_trust/record_url_request.rb
Instance Attribute Summary collapse
-
#oclc_number ⇒ Object
readonly
Returns the value of attribute oclc_number.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(oclc_number) ⇒ RecordUrlRequest
constructor
A new instance of RecordUrlRequest.
- #uri ⇒ Object
Constructor Details
#initialize(oclc_number) ⇒ RecordUrlRequest
Returns a new instance of RecordUrlRequest.
11 12 13 |
# File 'lib/berkeley_library/location/hathi_trust/record_url_request.rb', line 11 def initialize(oclc_number) @oclc_number = OCLCNumber.ensure_oclc_number!(oclc_number) end |
Instance Attribute Details
#oclc_number ⇒ Object (readonly)
Returns the value of attribute oclc_number.
9 10 11 |
# File 'lib/berkeley_library/location/hathi_trust/record_url_request.rb', line 9 def oclc_number @oclc_number end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 |
# File 'lib/berkeley_library/location/hathi_trust/record_url_request.rb', line 15 def execute response_body = URIs.get(uri, log: false) record_url_from(response_body, oclc_number) end |
#uri ⇒ Object
20 21 22 |
# File 'lib/berkeley_library/location/hathi_trust/record_url_request.rb', line 20 def uri @uri ||= URIs.append(volumes_base_uri, 'oclc', URIs.path_escape("#{oclc_number}.json")) end |