Class: EventMachine::FileGlobWatch::FileWatcher

Inherits:
EventMachine::FileWatch
  • Object
show all
Defined in:
lib/em/globwatcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(globwatch, &block) ⇒ FileWatcher

Returns a new instance of FileWatcher.



149
150
151
152
# File 'lib/em/globwatcher.rb', line 149

def initialize(globwatch, &block)
  @globwatch = globwatch
  @block = block
end

Instance Method Details

#file_deletedObject



159
160
161
# File 'lib/em/globwatcher.rb', line 159

def file_deleted
  block.call path
end

#file_movedObject



154
155
156
157
# File 'lib/em/globwatcher.rb', line 154

def file_moved
  stop_watching
  block.call path
end