Class: SdrClient::Deposit::MatchingFileGroupingStrategy
- Inherits:
-
Object
- Object
- SdrClient::Deposit::MatchingFileGroupingStrategy
- Defined in:
- lib/sdr_client/deposit/matching_file_grouping_strategy.rb
Overview
This strategy is for building one file set per set of similarly prefixed uploaded files
Class Method Summary collapse
-
.run(uploads: []) ⇒ Array<Array<SdrClient::Deposit::Files::DirectUploadResponse>>
Uploads the grouped uploaded files.
Class Method Details
.run(uploads: []) ⇒ Array<Array<SdrClient::Deposit::Files::DirectUploadResponse>>
Returns uploads the grouped uploaded files.
9 10 11 12 13 14 |
# File 'lib/sdr_client/deposit/matching_file_grouping_strategy.rb', line 9 def self.run(uploads: []) # Call `#values` on the result of the grouping operation because 1) # `Process#build_filesets` expects an array of arrays, not an array of # hashes, and 2) the keys aren't used anywhere uploads.group_by { |ul| ::File.basename(ul.filename, '.*') }.values end |