Class: SdrClient::Deposit::MetadataBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/sdr_client/deposit/metadata_builder.rb

Overview

Constructs the deposit metadata for the DRO

Instance Method Summary collapse

Constructor Details

#initialize(metadata:, grouping_strategy:, logger:) ⇒ MetadataBuilder

Additional metadata includes access, preserve, shelve, publish, md5, sha1

Parameters:

  • metadata (Request)

    information about the object

  • grouping_strategy (Class)

    class whose run method groups an array of uploads

  • logger (Logger)

    the logger to use



13
14
15
16
17
# File 'lib/sdr_client/deposit/metadata_builder.rb', line 13

def initialize(metadata:, grouping_strategy:, logger:)
  @metadata = 
  @logger = logger
  @grouping_strategy = grouping_strategy
end

Instance Method Details

#with_uploads(upload_responses) ⇒ Request

Returns the metadata with fileset information added in.

Parameters:

  • upload_responses (UploadFiles)

    the uploaded file information

Returns:

  • (Request)

    the metadata with fileset information added in.



21
22
23
24
# File 'lib/sdr_client/deposit/metadata_builder.rb', line 21

def with_uploads(upload_responses)
  file_sets = build_filesets(uploads: upload_responses)
  .with_file_sets(file_sets)
end