lib/cotton_tail/dsl/topic.rb in cotton-tail-0.2.1 vs lib/cotton_tail/dsl/topic.rb in cotton-tail-0.3.0
- old
+ new
@@ -7,12 +7,12 @@
def initialize(routing_prefix, context)
@routing_prefix = routing_prefix
@context = context
end
- def handle(routing_suffix, klass)
+ def handle(routing_suffix, handler = nil, &block)
key = routing_key(routing_suffix)
- @context.instance_eval { handle key, klass }
+ @context.instance_eval { handle key, handler, &block }
end
private
def routing_key(suffix)