Module: HubotGf::Worker
- Defined in:
- lib/hubotgf/worker.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#perform(method, sender, room, *args) ⇒ Object
Sidekiq entry.
- #rebroadcast(message) ⇒ Object
- #reply(message) ⇒ Object
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 |
# File 'lib/hubotgf/worker.rb', line 4 def self.included(base) @workers ||= [] @workers << base base.extend(ClassMethods) end |
.start(command, sender = nil, room = nil) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/hubotgf/worker.rb', line 10 def self.start(command, sender = nil, room = nil) worker = @workers.find { |w| w.commands.include? command } if worker command = worker.commands.match(command) arguments = command.arguments.unshift(command._method, sender, room) HubotGf::Config.perform.(worker, arguments) end end |
Instance Method Details
#perform(method, sender, room, *args) ⇒ Object
Sidekiq entry
20 21 22 23 |
# File 'lib/hubotgf/worker.rb', line 20 def perform(method, sender, room, *args) @sender, @room = sender, room send method, *args end |