Class: Mumukit::Nuntius::TaskConsumer::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/mumukit/nuntius/task_consumer.rb

Direct Known Subclasses

EventConsumer::Builder, JobConsumer::Builder

Instance Method Summary collapse

Constructor Details

#initializeBuilder

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

#buildObject



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