Class: RepositoryClient::Deposit::Request
- Inherits:
-
Object
- Object
- RepositoryClient::Deposit::Request
- Defined in:
- lib/repository_client/deposit/request.rb
Overview
This represents the metadata that we send to the server for doing a deposit
Constant Summary collapse
- CONTEXT =
'http://cocina.sul.stanford.edu/contexts/cocina-base.jsonld'
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(label:, type: 'http://cocina.sul.stanford.edu/models/object.jsonld', uploads: []) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(label:, type: 'http://cocina.sul.stanford.edu/models/object.jsonld', uploads: []) ⇒ Request
Returns a new instance of Request.
12 13 14 15 16 17 18 |
# File 'lib/repository_client/deposit/request.rb', line 12 def initialize(label:, type: 'http://cocina.sul.stanford.edu/models/object.jsonld', uploads: []) @label = label @type = type @uploads = uploads end |
Instance Method Details
#as_json ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/repository_client/deposit/request.rb', line 20 def as_json { "@context": CONTEXT, "@type": type, label: label, structural: { hasMember: file_sets_as_json } } end |