Sha256: 33bc7c8db5fdc0fa44c199732e609ff2f78d8d04de3060dc4a8eca90358f5e65

Contents?: true

Size: 880 Bytes

Versions: 3

Compression:

Stored size: 880 Bytes

Contents

# frozen_string_literal: true

module SdrClient
  module Deposit
    # This represents the File metadata that we send to the server for doing a deposit
    class File
      def initialize(external_identifier:, label:, filename:, access: 'dark', preserve: false, shelve: false)
        @external_identifier = external_identifier
        @label = label
        @filename = filename
        @access = access
        @preserve = preserve
        @shelve = shelve
      end

      def as_json
        {
          "type": 'http://cocina.sul.stanford.edu/models/file.jsonld',
          label: @label,
          filename: @filename,
          externalIdentifier: @external_identifier,
          access: {
            access: @access
          },
          administrative: {
            sdrPreserve: @preserve,
            shelve: @shelve
          }
        }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sdr-client-0.4.0 lib/sdr_client/deposit/file.rb
sdr-client-0.3.1 lib/sdr_client/deposit/file.rb
sdr-client-0.3.0 lib/sdr_client/deposit/file.rb