Class: FSWatcher::FoundFile
Overview
A FoundFile entry for the FileSystemWatcher
Instance Attribute Summary collapse
-
#fileName ⇒ Object
readonly
Returns the value of attribute fileName.
-
#md5 ⇒ Object
readonly
Returns the value of attribute md5.
-
#modTime ⇒ Object
readonly
Returns the value of attribute modTime.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#genMD5 ⇒ Object
generate my files md5 value.
-
#initialize(fileName, modTime, size, isNewFile = true, useMD5 = false) ⇒ FoundFile
constructor
A new instance of FoundFile.
- #isNew? ⇒ Boolean
- #setMD5(newMD5) ⇒ Object
- #updateModTime(modTime) ⇒ Object
- #updateSize(size) ⇒ Object
Constructor Details
#initialize(fileName, modTime, size, isNewFile = true, useMD5 = false) ⇒ FoundFile
Returns a new instance of FoundFile.
321 322 323 324 325 326 327 |
# File 'lib/doozer/watcher.rb', line 321 def initialize(fileName, modTime, size, isNewFile=true, useMD5=false) @fileName, @modTime, @size, @isNewFile = fileName, modTime, size, isNewFile @md5 = nil if useMD5 then genMD5() end end |
Instance Attribute Details
#fileName ⇒ Object (readonly)
Returns the value of attribute fileName.
319 320 321 |
# File 'lib/doozer/watcher.rb', line 319 def fileName @fileName end |
#md5 ⇒ Object (readonly)
Returns the value of attribute md5.
319 320 321 |
# File 'lib/doozer/watcher.rb', line 319 def md5 @md5 end |
#modTime ⇒ Object (readonly)
Returns the value of attribute modTime.
319 320 321 |
# File 'lib/doozer/watcher.rb', line 319 def modTime @modTime end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
319 320 321 |
# File 'lib/doozer/watcher.rb', line 319 def size @size end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
319 320 321 |
# File 'lib/doozer/watcher.rb', line 319 def status @status end |
Instance Method Details
#genMD5 ⇒ Object
generate my files md5 value
347 348 349 |
# File 'lib/doozer/watcher.rb', line 347 def genMD5() @md5 = FSWatcher.genFileMD5(@fileName) end |
#isNew? ⇒ Boolean
338 339 340 |
# File 'lib/doozer/watcher.rb', line 338 def isNew? return @isNewFile end |
#setMD5(newMD5) ⇒ Object
342 343 344 |
# File 'lib/doozer/watcher.rb', line 342 def setMD5(newMD5) @md5 = newMD5 end |
#updateModTime(modTime) ⇒ Object
329 330 331 332 |
# File 'lib/doozer/watcher.rb', line 329 def updateModTime(modTime) @modTime = modTime @isNewFile = false end |
#updateSize(size) ⇒ Object
334 335 336 |
# File 'lib/doozer/watcher.rb', line 334 def updateSize(size) @size = size end |