Class: FChange::Event
- Inherits:
-
Object
- Object
- FChange::Event
- Defined in:
- lib/rb-fchange/event.rb
Overview
An event caused by a change on the filesystem. Each Watcher can fire many events, which are passed to that watcher’s callback.
Instance Attribute Summary collapse
-
#watcher ⇒ Watcher
readonly
The Watcher that fired this event.
Instance Method Summary collapse
-
#callback! ⇒ Object
Calls the callback of the watcher that fired this event, passing in the event itself.
-
#initialize(watcher) ⇒ Event
constructor
Creates an event from a string of binary data.
Constructor Details
#initialize(watcher) ⇒ Event
Creates an event from a string of binary data. Differs from Event.consume in that it doesn’t modify the string.
16 17 18 |
# File 'lib/rb-fchange/event.rb', line 16 def initialize(watcher) @watcher = watcher end |
Instance Attribute Details
Instance Method Details
#callback! ⇒ Object
Calls the callback of the watcher that fired this event, passing in the event itself.
24 25 26 |
# File 'lib/rb-fchange/event.rb', line 24 def callback! @watcher.callback!(self) end |