Method: Sc2::Connection#add_listener
- Defined in:
- lib/sc2ai/connection.rb
#add_listener(listener, klass:) ⇒ void
This method returns an undefined value.
Add a listener of specific callback type
86 87 88 89 |
# File 'lib/sc2ai/connection.rb', line 86 def add_listener(listener, klass:) @listeners[klass.to_s] ||= [] @listeners[klass.to_s].push(listener) end |