Module: Observr::EventHandler::Base Abstract
- Includes:
- Observable
- Defined in:
- lib/observr/event_handlers/base.rb
Overview
This module is abstract.
Base functionality mixin, meant to be included in specific event handlers.
Instance Method Summary collapse
-
#listen(monitored_paths) ⇒ undefined
abstract
Begin watching given paths and enter listening loop.
-
#notify(path, event_type = nil) ⇒ undefined
Notify that a file was modified.
-
#refresh(monitored_paths) ⇒ undefined
abstract
Called by the controller when the list of paths monitored by wantchr has changed.
Instance Method Details
#listen(monitored_paths) ⇒ undefined
This method is abstract.
Begin watching given paths and enter listening loop. Called by the controller.
39 40 41 |
# File 'lib/observr/event_handlers/base.rb', line 39 def listen(monitored_paths) raise AbstractMethod end |
#notify(path, event_type = nil) ⇒ undefined
Notify that a file was modified.
25 26 27 28 |
# File 'lib/observr/event_handlers/base.rb', line 25 def notify(path, event_type = nil) changed(true) notify_observers(path, event_type) end |
#refresh(monitored_paths) ⇒ undefined
This method is abstract.
Called by the controller when the list of paths monitored by wantchr has changed. It should refresh the list of paths being watched.
52 53 54 |
# File 'lib/observr/event_handlers/base.rb', line 52 def refresh(monitored_paths) raise AbstractMethod end |