Class: FSWatcher::Directory
- Inherits:
-
Object
- Object
- FSWatcher::Directory
- Defined in:
- lib/filesystemwatcher/filesystemwatcher.rb
Overview
The directory to watch
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
Instance Method Summary collapse
- #getFiles ⇒ Object
-
#initialize(dir, expression) ⇒ Directory
constructor
A new instance of Directory.
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
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
240 241 242 |
# File 'lib/filesystemwatcher/filesystemwatcher.rb', line 240 def dir @dir end |
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
240 241 242 |
# File 'lib/filesystemwatcher/filesystemwatcher.rb', line 240 def expression @expression end |
Instance Method Details
#getFiles ⇒ Object
247 248 249 |
# File 'lib/filesystemwatcher/filesystemwatcher.rb', line 247 def getFiles() return Dir[@dir + "/" + @expression] end |