Module: Seahorse::Client::EventEmitter
- Defined in:
- lib/seahorse/client/events.rb
Instance Method Summary collapse
- #emit(event_name, *args, &block) ⇒ Object
- #initialize(*args) ⇒ Object
- #signal(event, *args) ⇒ Object
Instance Method Details
#emit(event_name, *args, &block) ⇒ Object
10 11 12 13 |
# File 'lib/seahorse/client/events.rb', line 10 def emit(event_name, *args, &block) @listeners[event_name] ||= [] @listeners[event_name] << Proc.new end |
#initialize(*args) ⇒ Object
5 6 7 8 |
# File 'lib/seahorse/client/events.rb', line 5 def initialize(*args) @listeners = {} super end |
#signal(event, *args) ⇒ Object
15 16 17 |
# File 'lib/seahorse/client/events.rb', line 15 def signal(event, *args) @listeners end |