Class: Dor::Services::Client::Collections
- Inherits:
-
VersionedService
- Object
- VersionedService
- Dor::Services::Client::Collections
- Defined in:
- lib/dor/services/client/collections.rb
Overview
API calls that are queries about a particular object. This attempts to parallel the Valkyrie QueryService interface (e.g. github.com/samvera/valkyrie/blob/master/lib/valkyrie/persistence/memory/query_service.rb)
Constant Summary
Constants inherited from VersionedService
VersionedService::EXCEPTION_CLASS, VersionedService::JSON_API_MIME_TYPE
Instance Method Summary collapse
-
#collections ⇒ Array<Cocina::Models::DRO>
Get a list of the collections.
-
#initialize(connection:, version:, object_identifier:) ⇒ Collections
constructor
A new instance of Collections.
Methods inherited from VersionedService
#async_result, #with_querystring
Constructor Details
#initialize(connection:, version:, object_identifier:) ⇒ Collections
Returns a new instance of Collections.
11 12 13 14 |
# File 'lib/dor/services/client/collections.rb', line 11 def initialize(connection:, version:, object_identifier:) super(connection: connection, version: version) @object_identifier = object_identifier end |
Instance Method Details
#collections ⇒ Array<Cocina::Models::DRO>
Get a list of the collections. (Similar to Valkyrie’s find_inverse_references_by)
19 20 21 22 23 24 25 26 27 |
# File 'lib/dor/services/client/collections.rb', line 19 def collections resp = connection.get do |req| req.url "#{query_path}/collections" end return response_to_models(resp) if resp.success? raise_exception_based_on_response!(resp, object_identifier) end |