Class: EMDirWatcher::NameGlobMatcher
- Inherits:
-
Object
- Object
- EMDirWatcher::NameGlobMatcher
- Defined in:
- lib/em-dir-watcher/tree.rb
Instance Method Summary collapse
-
#initialize(glob) ⇒ NameGlobMatcher
constructor
A new instance of NameGlobMatcher.
- #matches?(relative_path) ⇒ Boolean
Constructor Details
#initialize(glob) ⇒ NameGlobMatcher
Returns a new instance of NameGlobMatcher.
132 133 134 |
# File 'lib/em-dir-watcher/tree.rb', line 132 def initialize glob @glob = glob end |
Instance Method Details
#matches?(relative_path) ⇒ Boolean
135 136 137 |
# File 'lib/em-dir-watcher/tree.rb', line 135 def matches? relative_path File.fnmatch?(@glob, File.basename(relative_path)) end |