Class: Moab::FileInstanceDifference

Inherits:
Serializable
  • Object
show all
Includes:
HappyMapper
Defined in:
lib/moab/file_instance_difference.rb

Overview

Note:

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

A container for recording difference information at the file level

  • If there was no change, the change type is set to identical

  • If the signature is unchanged, but the path has moved, the change type is set to renamed

  • If path is unchanged, but the signature has changed, the change type is set to modified and both signatures are reported

  • If the signature and path are only in the basis inventory, the change type is set to deleted

  • If the signature and path are only in the other inventory, the change type is set to added

This is a child element of FileGroupDifferenceSubset, which is in turn a descendent of FileInventoryDifference, the documentation of which contains a full example

Data Model

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ FileInstanceDifference

Returns a new instance of FileInstanceDifference


31
32
33
34
# File 'lib/moab/file_instance_difference.rb', line 31

def initialize(opts={})
  @signatures = Array.new
  super(opts)
end

Instance Attribute Details

#basis_pathString

Returns The file's path in the basis inventory (usually for an old version)

Returns:

  • (String)

    The file's path in the basis inventory (usually for an old version)


42
# File 'lib/moab/file_instance_difference.rb', line 42

attribute :basis_path, String, :tag => 'basisPath', :on_save => Proc.new { |s| s.to_s }

#changeString

Returns The type of file change

Returns:

  • (String)

    The type of file change


38
# File 'lib/moab/file_instance_difference.rb', line 38

attribute :change, String

#other_pathString

Returns The file's path in the other inventory (usually for an new version) compared against the basis

Returns:

  • (String)

    The file's path in the other inventory (usually for an new version) compared against the basis


46
# File 'lib/moab/file_instance_difference.rb', line 46

attribute :other_path, String, :tag => 'otherPath', :on_save => Proc.new { |s| s.to_s }

#signaturesArray<FileSignature>

Returns The fixity data of the file manifestation(s) (plural if change was a content modification)

Returns:

  • (Array<FileSignature>)

    The fixity data of the file manifestation(s) (plural if change was a content modification)


50
# File 'lib/moab/file_instance_difference.rb', line 50

has_many :signatures, FileSignature, :tag => 'fileSignature'