Sha256: c50bc9ddb9e09e8c2457c547d135a8bf02ea0837eac202b82b034f7fd5f1c63a

Contents?: true

Size: 816 Bytes

Versions: 1

Compression:

Stored size: 816 Bytes

Contents

module Hydra::Works
  class AddRelatedObjectToGenericWork

    ##
    # Add a related object to a generic work.
    #
    # @param [Hydra::Works::GenericWork::Base] :parent_generic_work to which to add the related object
    # @param [Hydra::PCDM::Object] :child_related_object being added
    #
    # @return [Hydra::Works::GenericWork::Base] the updated hydra works generic work

    def self.call( parent_generic_work, child_related_object )
      raise ArgumentError, 'parent_generic_work must be a hydra-works generic work' unless Hydra::Works.generic_work? parent_generic_work
      raise ArgumentError, 'child_related_object must be a pcdm object' unless Hydra::PCDM.object? child_related_object
      Hydra::PCDM::AddRelatedObjectToObject.call( parent_generic_work, child_related_object )
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hydra-works-0.0.1 lib/hydra/works/services/generic_work/add_related_object.rb