Class: Dor::Services::Client::Members

Inherits:
VersionedService show all
Defined in:
lib/dor/services/client/members.rb

Overview

API call that queries the members of a collection.

Defined Under Namespace

Classes: Member

Constant Summary

Constants inherited from VersionedService

VersionedService::EXCEPTION_CLASS, VersionedService::JSON_API_MIME_TYPE

Instance Method Summary collapse

Methods inherited from VersionedService

#async_result, #with_querystring

Constructor Details

#initialize(connection:, version:, object_identifier:) ⇒ Members

Returns a new instance of Members.

Parameters:

  • object_identifier (String)

    the pid for the object



11
12
13
14
# File 'lib/dor/services/client/members.rb', line 11

def initialize(connection:, version:, object_identifier:)
  super(connection: connection, version: version)
  @object_identifier = object_identifier
end

Instance Method Details

#membersArray<Member>

Get a list of the members.

Returns:

Raises:



19
20
21
22
23
24
25
26
27
# File 'lib/dor/services/client/members.rb', line 19

def members
  resp = connection.get do |req|
    req.url members_path
  end

  return response_to_models(resp) if resp.success?

  raise_exception_based_on_response!(resp, object_identifier)
end