Class: EaseEngine::Watcher::Info
- Inherits:
-
Cool.io::IOWatcher
- Object
- Cool.io::IOWatcher
- EaseEngine::Watcher::Info
- Defined in:
- lib/ease_engine/watcher.rb
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
Returns the value of attribute callbacks.
-
#io ⇒ Object
Returns the value of attribute io.
Instance Method Summary collapse
-
#initialize(io, flags, callbacks) ⇒ Info
constructor
A new instance of Info.
- #on_readable ⇒ Object
- #on_remove ⇒ Object
- #on_writable ⇒ Object
Constructor Details
#initialize(io, flags, callbacks) ⇒ Info
Returns a new instance of Info.
9 10 11 12 13 14 |
# File 'lib/ease_engine/watcher.rb', line 9 def initialize( io, flags, callbacks ) @io = io @callbacks = callbacks super( io.kind_of?( EaseEngine::Socket ) ? io.socket : io, flags ) end |
Instance Attribute Details
#callbacks ⇒ Object
Returns the value of attribute callbacks.
7 8 9 |
# File 'lib/ease_engine/watcher.rb', line 7 def callbacks @callbacks end |
#io ⇒ Object
Returns the value of attribute io.
7 8 9 |
# File 'lib/ease_engine/watcher.rb', line 7 def io @io end |
Instance Method Details
#on_readable ⇒ Object
16 17 18 |
# File 'lib/ease_engine/watcher.rb', line 16 def on_readable @callbacks[ :on_read ].call( @io ) if @callbacks.key?( :on_read ) end |
#on_remove ⇒ Object
24 25 26 |
# File 'lib/ease_engine/watcher.rb', line 24 def on_remove @callbacks[ :on_remove ].call( @io ) if @callbacks.key?( :on_remove ) end |
#on_writable ⇒ Object
20 21 22 |
# File 'lib/ease_engine/watcher.rb', line 20 def on_writable @callbacks[ :on_write ].call( @io ) if @callbacks.key?( :on_write ) end |