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.



166
167
168
169
# File 'lib/em/globwatcher.rb', line 166

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

Instance Method Details

#file_deletedObject



176
177
178
# File 'lib/em/globwatcher.rb', line 176

def file_deleted
  block.call path
end

#file_movedObject



171
172
173
174
# File 'lib/em/globwatcher.rb', line 171

def file_moved
  stop_watching
  block.call path
end