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 ⇒ Integer
Gets the current version number for the object.
-
#initialize(connection:, version:, object_identifier:) ⇒ SDR
constructor
A new instance of SDR.
Constructor Details
#initialize(connection:, version:, object_identifier:) ⇒ SDR
Returns a new instance of SDR.
11 12 13 14 |
# File 'lib/dor/services/client/sdr.rb', line 11 def initialize(connection:, version:, object_identifier:) super(connection: connection, version: version) @object_identifier = object_identifier end |
Instance Method Details
#current_version ⇒ Integer
Gets the current version number for the object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/dor/services/client/sdr.rb', line 20 def current_version xml = current_version_response 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 |