class Synqa::FileContent
An object representing the content of a file within a ContentTree
. The file may be marked for copying (if it's in a source ContentTree
) or for deletion (if it's in a destination ContentTree
)
Attributes
copyDestination[R]
The destination to which the file should be copied
hash[R]
The hash value of the file's contents
name[R]
The name of the file
parentPathElements[R]
The components of the relative path where the file is found
toBeDeleted[R]
Should this file be deleted
Public Class Methods
new(name, hash, parentPathElements)
click to toggle source
# File lib/synqa.rb, line 435 def initialize(name, hash, parentPathElements) @name = name @hash = hash @parentPathElements = parentPathElements @copyDestination = nil @toBeDeleted = false end
Public Instance Methods
markToCopy(destinationDirectory)
click to toggle source
Mark this file to be copied to a destination directory (from a destination content tree)
# File lib/synqa.rb, line 444 def markToCopy(destinationDirectory) @copyDestination = destinationDirectory end
markToDelete()
click to toggle source
Mark this file to be deleted
# File lib/synqa.rb, line 449 def markToDelete @toBeDeleted = true end
relativePath()
click to toggle source
The relative name of this file in the content tree (relative to the base dir)
# File lib/synqa.rb, line 458 def relativePath return (parentPathElements + [name]).join("/") end
to_s()
click to toggle source
# File lib/synqa.rb, line 453 def to_s return "#{name} (#{hash})" end