Sha256: f20403ee2584ebf82fb20fbacddbd3769d859fc127247f5313fc6aa24ae6705f
Contents?: true
Size: 849 Bytes
Versions: 8
Compression:
Stored size: 849 Bytes
Contents
# frozen_string_literal: true module SdrClient class RedesignedClient # This strategy is for building one file set per set of similarly prefixed uploaded files class MatchingFileGroupingStrategy # @param [Array<SdrClient::RedesignedClient::DirectUploadResponse>] uploads the uploaded files to attach. # @return [Array<Array<SdrClient::RedesignedClient::DirectUploadResponse>>] uploads the grouped uploaded files. def self.run(uploads: []) # Call `#values` on the result of the grouping operation because: # 1) `StructuralGrouper#build_filesets` expects an array of arrays (not hashes); and # 2) the keys aren't used anywhere uploads.group_by do |ul| ::File.join(::File.dirname(ul.filename), ::File.basename(ul.filename, '.*')) end.values end end end end
Version data entries
8 entries across 8 versions & 1 rubygems