Class: Dor::Services::Client::ReleaseTags
- Inherits:
-
VersionedService
- Object
- VersionedService
- Dor::Services::Client::ReleaseTags
- Defined in:
- lib/dor/services/client/release_tags.rb
Overview
API calls that are about a repository object
Instance Method Summary collapse
-
#create(release:, what:, to:, who:) ⇒ Boolean
Creates a new release tag for the object rubocop:disable Metrics/MethodLength.
-
#initialize(connection:, version:, object_identifier:) ⇒ ReleaseTags
constructor
A new instance of ReleaseTags.
Constructor Details
#initialize(connection:, version:, object_identifier:) ⇒ ReleaseTags
Returns a new instance of ReleaseTags.
9 10 11 12 |
# File 'lib/dor/services/client/release_tags.rb', line 9 def initialize(connection:, version:, object_identifier:) super(connection: connection, version: version) @object_identifier = object_identifier end |
Instance Method Details
#create(release:, what:, to:, who:) ⇒ Boolean
Creates a new release tag for the object rubocop:disable Metrics/MethodLength
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/dor/services/client/release_tags.rb', line 22 def create(release:, what:, to:, who:) params = { to: to, who: who, what: what, release: release } resp = connection.post do |req| req.url "#{api_version}/objects/#{object_identifier}/release_tags" req.headers['Content-Type'] = 'application/json' req.body = params.to_json end raise UnexpectedResponse, ResponseErrorFormatter.format(response: resp) unless resp.success? true end |