Class: Dor::Services::Client::SDR
- Inherits:
-
VersionedService
- Object
- VersionedService
- Dor::Services::Client::SDR
- Defined in:
- lib/dor/services/client/sdr.rb
Overview
API calls that are about preserved objects
Instance Method Summary collapse
-
#current_version(object:) ⇒ Integer
Gets the current version number for the object.
Methods inherited from VersionedService
Constructor Details
This class inherits a constructor from Dor::Services::Client::VersionedService
Instance Method Details
#current_version(object:) ⇒ Integer
Gets the current version number for the object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dor/services/client/sdr.rb', line 13 def current_version(object:) xml = current_version_response(object: object) begin doc = Nokogiri::XML xml raise if doc.root.name != 'currentVersion' return Integer(doc.text) rescue StandardError raise MalformedResponse, "Unable to parse XML from current_version API call: #{xml}" end end |