Class: Replication::Replica
- Inherits:
-
Object
- Object
- Replication::Replica
- Defined in:
- lib/replication/replica.rb
Overview
Copyright © 2014 by The Board of Trustees of the Leland Stanford Junior University. All rights reserved. See LICENSE for details.
The metadata concerning the digital object/version that is the subject of replication.
Constant Summary collapse
- @@replica_cache_pathname =
nil
Instance Attribute Summary collapse
-
#bagit_bag ⇒ BagitBag
A bag containing a copy of the replica.
-
#create_date ⇒ Time
The timestamp of the datetime at which the replica was created.
-
#home_repository ⇒ String
The original home location of the replica (sdr or dpn).
-
#payload_fixity ⇒ String
The value of the checksum/digest.
-
#payload_fixity_type ⇒ String
The type of checksum/digest type (:sha1, :sha256).
-
#payload_size ⇒ Integer
The size (in bytes) of the replic bag’s payload.
-
#replica_id ⇒ String
The unique identifier for the digital object replica.
Class Method Summary collapse
-
.replica_cache_pathname ⇒ Pathname
The base location of the replica cache.
-
.replica_cache_pathname=(replica_cache_pathname) ⇒ Pathname
Set the base location of the replica cache.
Instance Method Summary collapse
-
#initialize(replica_id, home_repository) ⇒ Replica
constructor
Initialize a new Replica object.
-
#replica_pathname ⇒ Pathname
The location of the replica bag.
Constructor Details
#initialize(replica_id, home_repository) ⇒ Replica
Returns Initialize a new Replica object.
49 50 51 52 |
# File 'lib/replication/replica.rb', line 49 def initialize(replica_id, home_repository) @replica_id = replica_id @home_repository = home_repository end |
Instance Attribute Details
#bagit_bag ⇒ BagitBag
Returns A bag containing a copy of the replica.
35 36 37 |
# File 'lib/replication/replica.rb', line 35 def bagit_bag @bagit_bag end |
#create_date ⇒ Time
Returns The timestamp of the datetime at which the replica was created.
32 33 34 |
# File 'lib/replication/replica.rb', line 32 def create_date @create_date end |
#home_repository ⇒ String
Returns The original home location of the replica (sdr or dpn).
29 30 31 |
# File 'lib/replication/replica.rb', line 29 def home_repository @home_repository end |
#payload_fixity ⇒ String
Returns The value of the checksum/digest.
44 45 46 |
# File 'lib/replication/replica.rb', line 44 def payload_fixity @payload_fixity end |
#payload_fixity_type ⇒ String
Returns The type of checksum/digest type (:sha1, :sha256).
41 42 43 |
# File 'lib/replication/replica.rb', line 41 def payload_fixity_type @payload_fixity_type end |
#payload_size ⇒ Integer
Returns The size (in bytes) of the replic bag’s payload.
38 39 40 |
# File 'lib/replication/replica.rb', line 38 def payload_size @payload_size end |
#replica_id ⇒ String
Returns The unique identifier for the digital object replica.
26 27 28 |
# File 'lib/replication/replica.rb', line 26 def replica_id @replica_id end |
Class Method Details
.replica_cache_pathname ⇒ Pathname
Returns The base location of the replica cache.
15 16 17 |
# File 'lib/replication/replica.rb', line 15 def Replica.replica_cache_pathname @@replica_cache_pathname end |
.replica_cache_pathname=(replica_cache_pathname) ⇒ Pathname
Returns Set the base location of the replica cache.
21 22 23 |
# File 'lib/replication/replica.rb', line 21 def Replica.replica_cache_pathname=(replica_cache_pathname) @@replica_cache_pathname = Pathname(replica_cache_pathname) end |
Instance Method Details
#replica_pathname ⇒ Pathname
Returns The location of the replica bag.
55 56 57 |
# File 'lib/replication/replica.rb', line 55 def replica_pathname @replica_pathname ||= @@replica_cache_pathname.join(home_repository,replica_id) end |