Method: Messaging::Routes#inline!

Defined in:
lib/messaging/routes.rb

#inline!(&block) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/messaging/routes.rb', line 25

def inline!(&block)
  current_routes = @routes.dup
  consumer_definitions.each do |_, definition|
    definition.fetch(:block)&.call(self)
  end

  block.call

ensure
  clear_routes!
  @routes = current_routes
end