sdr-client 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sdr_client/deposit/file_set.rb +4 -2
- data/lib/sdr_client/deposit/request.rb +3 -1
- data/lib/sdr_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c634551367640a9eb3647e55fcac169a61b40af1a111582d3e857bc2cc1f020
|
4
|
+
data.tar.gz: 75f3a024adf97dad2cf85a8e8b117a232c71b2f644655b98752c1320af005e17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04a14d2edbb8334fbcc13b7ae131d7bf1697869c580395c2ea8c2971c18b911d55b7b0128e0cdff25b7a5844333f11eb2af23bc435ab7c6e692e4951092e22ed
|
7
|
+
data.tar.gz: 6c3369f015d8e3201ba1f58664c4d9b15208064eb5fdd24deca2de26ae7d4575889d22f7aa25eacb2e1232cfd2068d288771c6ba0c04737b7e5fc6c7508d2ba8
|
@@ -4,7 +4,8 @@ module SdrClient
|
|
4
4
|
module Deposit
|
5
5
|
# This represents the FileSet metadata that we send to the server for doing a deposit
|
6
6
|
class FileSet
|
7
|
-
def initialize(uploads: [], files: [])
|
7
|
+
def initialize(uploads: [], files: [], label:)
|
8
|
+
@label = label
|
8
9
|
@files = if !uploads.empty?
|
9
10
|
uploads.map do |upload|
|
10
11
|
File.new(external_identifier: upload.signed_id, label: upload.filename, filename: upload.filename)
|
@@ -17,6 +18,7 @@ module SdrClient
|
|
17
18
|
def as_json
|
18
19
|
{
|
19
20
|
"type": 'http://cocina.sul.stanford.edu/models/fileset.jsonld',
|
21
|
+
"label": label,
|
20
22
|
structural: {
|
21
23
|
hasMember: files.map(&:as_json)
|
22
24
|
}
|
@@ -25,7 +27,7 @@ module SdrClient
|
|
25
27
|
|
26
28
|
private
|
27
29
|
|
28
|
-
attr_reader :files
|
30
|
+
attr_reader :files, :label
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
@@ -38,7 +38,9 @@ module SdrClient
|
|
38
38
|
# @param [Array<SdrClient::Deposit::Files::DirectUploadResponse>] uploads the uploaded files to attach.
|
39
39
|
# @return [Request] a clone of this request with the uploads added
|
40
40
|
def with_uploads(uploads)
|
41
|
-
file_sets = uploads.map
|
41
|
+
file_sets = uploads.each_with_index.map do |upload, i|
|
42
|
+
FileSet.new(uploads: [upload], label: "Object #{i + 1}")
|
43
|
+
end
|
42
44
|
|
43
45
|
Request.new(label: label,
|
44
46
|
apo: apo,
|
data/lib/sdr_client/version.rb
CHANGED