Class: SdrClient::RedesignedClient::FileSet
- Inherits:
-
Object
- Object
- SdrClient::RedesignedClient::FileSet
- Defined in:
- lib/sdr_client/redesigned_client/file_set.rb
Overview
This represents the FileSet metadata that we send to the server for doing a deposit
Instance Method Summary collapse
-
#initialize(label:, type_strategy:, uploads: [], uploads_metadata: {}, files: []) ⇒ FileSet
constructor
A new instance of FileSet.
- #to_h ⇒ Object
Constructor Details
#initialize(label:, type_strategy:, uploads: [], uploads_metadata: {}, files: []) ⇒ FileSet
12 13 14 15 16 |
# File 'lib/sdr_client/redesigned_client/file_set.rb', line 12 def initialize(label:, type_strategy:, uploads: [], uploads_metadata: {}, files: []) @label = label @type_strategy = type_strategy @files = uploads.empty? ? files : files_from(uploads, ) end |
Instance Method Details
#to_h ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sdr_client/redesigned_client/file_set.rb', line 18 def to_h { type: type_strategy.run(files: files), label: label, structural: { contains: files.map(&:to_h) }, version: 1 } end |