Class: Moab::SignatureCatalogEntry

Inherits:
Serializer::Serializable show all
Includes:
HappyMapper
Defined in:
lib/moab/signature_catalog_entry.rb

Overview

Note:

Copyright © 2012 by The Board of Trustees of the Leland Stanford Junior University. All rights reserved. See LICENSE for details.

A file-level entry in a digital object’s SignatureCatalog. It has a child FileSignature element that identifies the file’s contents (the bytestream) along with data that specfies the SDR storage location that was used to preserve a single file instance.

Data Model

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Serializer::Serializable

#array_to_hash, deep_diff, #diff, #key, #key_name, #summary, #to_hash, #to_json, #to_yaml, #variable_names, #variables

Constructor Details

#initialize(opts = {}) ⇒ SignatureCatalogEntry

Returns a new instance of SignatureCatalogEntry.



22
23
24
# File 'lib/moab/signature_catalog_entry.rb', line 22

def initialize(opts = {})
  super(opts)
end

Instance Attribute Details

#group_idString

Returns The name of the file group.

Returns:

  • (String)

    The name of the file group



32
# File 'lib/moab/signature_catalog_entry.rb', line 32

attribute :group_id, String, :tag => 'groupId', :key => true

#pathString

Returns The id is the filename path, relative to the file group’s base directory.

Returns:

  • (String)

    The id is the filename path, relative to the file group’s base directory



36
# File 'lib/moab/signature_catalog_entry.rb', line 36

attribute :path, String, :key => true, :tag => 'storagePath'

#signatureFileSignature

Returns The fixity data of the file instance.

Returns:



40
# File 'lib/moab/signature_catalog_entry.rb', line 40

element :signature, FileSignature, :tag => 'fileSignature'

#version_idInteger

Returns The ordinal version number.

Returns:

  • (Integer)

    The ordinal version number



28
# File 'lib/moab/signature_catalog_entry.rb', line 28

attribute :version_id, Integer, :tag => 'originalVersion', :key => true, :on_save => proc { |n| n.to_s }

Instance Method Details

#storage_pathString

Returns the storage path to a file, relative to the object storage home directory

Returns:

  • (String)

    Returns the storage path to a file, relative to the object storage home directory



53
54
55
# File 'lib/moab/signature_catalog_entry.rb', line 53

def storage_path
  File.join(StorageObject.version_dirname(version_id), 'data', group_id, path)
end