Class: Rednode::EventEmitter
- Inherits:
-
Object
- Object
- Rednode::EventEmitter
- Defined in:
- lib/rednode/events.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#_events ⇒ Object
Returns the value of attribute _events.
Instance Method Summary collapse
Instance Attribute Details
#_events ⇒ Object
Returns the value of attribute _events.
3 4 5 |
# File 'lib/rednode/events.rb', line 3 def _events @_events end |
Instance Method Details
#emit(e, *args) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rednode/events.rb', line 5 def emit(e, *args) return unless @_events case notify = @_events[e] when V8::Function notify.methodcall(self, *args) when V8::Array notify.each {|listener| listener.methodcall(self, *args) if listener} else return false end return true end |