Method: Cinch::Plugin::ClassMethods#listen_to
- Defined in:
- lib/cinch/plugin.rb
#listen_to(*types, options = {}) ⇒ Array<Listener>
Events to listen to.
231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/cinch/plugin.rb', line 231 def listen_to(*types) = {:method => :listen} if types.last.is_a?(Hash) .merge!(types.pop) end listeners = types.map {|type| Listener.new(type.to_s.to_sym, [:method])} @listeners.concat listeners listeners end |