Class: Bowline::Watcher::Callback
Instance Attribute Summary (collapse)
-
- (Object) event
readonly
Returns the value of attribute event.
-
- (Object) oneshot
readonly
Returns the value of attribute oneshot.
-
- (Object) prok
readonly
Returns the value of attribute prok.
Instance Method Summary (collapse)
-
- (Object) call(*args)
Execute callback.
-
- (Callback) initialize(watcher, event, prok, oneshot = false)
constructor
A new instance of Callback.
-
- (Object) remove
Remove callback from watcher.
Constructor Details
- (Callback) initialize(watcher, event, prok, oneshot = false)
A new instance of Callback
71 72 73 74 75 76 |
# File 'lib/bowline/watcher.rb', line 71 def initialize(watcher, event, prok, oneshot = false) @watcher = watcher @event = event @prok = prok @oneshot = oneshot end |
Instance Attribute Details
- (Object) event (readonly)
Returns the value of attribute event
69 70 71 |
# File 'lib/bowline/watcher.rb', line 69 def event @event end |
- (Object) oneshot (readonly)
Returns the value of attribute oneshot
69 70 71 |
# File 'lib/bowline/watcher.rb', line 69 def oneshot @oneshot end |
- (Object) prok (readonly)
Returns the value of attribute prok
69 70 71 |
# File 'lib/bowline/watcher.rb', line 69 def prok @prok end |
Instance Method Details
- (Object) call(*args)
Execute callback
79 80 81 82 |
# File 'lib/bowline/watcher.rb', line 79 def call(*args) prok.call(*args) remove if oneshot end |
- (Object) remove
Remove callback from watcher
85 86 87 |
# File 'lib/bowline/watcher.rb', line 85 def remove @watcher.remove(@event, @prok) end |