Class: Moab::SignatureCatalogEntry
- Inherits:
-
Serializer::Serializable
- Object
- Serializer::Serializable
- Moab::SignatureCatalogEntry
- Includes:
- HappyMapper
- Defined in:
- lib/moab/signature_catalog_entry.rb
Overview
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
-
SignatureCatalog = lookup table containing a cumulative collection of all files ever ingested
-
SignatureCatalogEntry [1..*] = an row in the lookup table containing storage information about a single file
-
FileSignature [1] = file fixity information
-
-
Instance Attribute Summary collapse
-
#group_id ⇒ String
The name of the file group.
-
#path ⇒ String
The id is the filename path, relative to the file group’s base directory.
-
#signature ⇒ FileSignature
The fixity data of the file instance.
-
#version_id ⇒ Integer
The ordinal version number.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ SignatureCatalogEntry
constructor
A new instance of SignatureCatalogEntry.
-
#storage_path ⇒ String
Returns the storage path to a file, relative to the object storage home directory.
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_id ⇒ String
Returns The name of the file group.
32 |
# File 'lib/moab/signature_catalog_entry.rb', line 32 attribute :group_id, String, :tag => 'groupId', :key => true |
#path ⇒ String
Returns 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' |
#signature ⇒ FileSignature
Returns The fixity data of the file instance.
40 |
# File 'lib/moab/signature_catalog_entry.rb', line 40 element :signature, FileSignature, :tag => 'fileSignature' |
#version_id ⇒ Integer
Returns 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_path ⇒ 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 |