Class: Mumukit::Nuntius::TaskConsumer::Builder
- Inherits:
-
Object
- Object
- Mumukit::Nuntius::TaskConsumer::Builder
show all
- Defined in:
- lib/mumukit/nuntius/task_consumer.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Builder.
4
5
6
|
# File 'lib/mumukit/nuntius/task_consumer.rb', line 4
def initialize
@handlers = {}
end
|
Instance Method Details
#build ⇒ Object
12
13
14
|
# File 'lib/mumukit/nuntius/task_consumer.rb', line 12
def build
@handlers.with_indifferent_access
end
|
#task(key, &block) ⇒ Object
8
9
10
|
# File 'lib/mumukit/nuntius/task_consumer.rb', line 8
def task(key, &block)
@handlers[key] = with_database_reconnection &block
end
|