Class: FSWatcher::Directory

Inherits:
Object
  • Object
show all
Defined in:
lib/filesystemwatcher/filesystemwatcher.rb

Overview

The directory to watch

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir, expression) ⇒ Directory

Returns a new instance of Directory.



242
243
244
245
# File 'lib/filesystemwatcher/filesystemwatcher.rb', line 242

def initialize(dir, expression)
  @dir, @expression = dir, expression
  @dir.chop! if @dir =~ %r{/$}
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



240
241
242
# File 'lib/filesystemwatcher/filesystemwatcher.rb', line 240

def dir
  @dir
end

#expressionObject (readonly)

Returns the value of attribute expression.



240
241
242
# File 'lib/filesystemwatcher/filesystemwatcher.rb', line 240

def expression
  @expression
end

Instance Method Details

#getFilesObject



247
248
249
# File 'lib/filesystemwatcher/filesystemwatcher.rb', line 247

def getFiles()
  return Dir[@dir + "/" + @expression]
end