Module: Legion::Extensions::Transport::AutoBuild

Defined in:
lib/legion/extensions/transport/autobuild.rb

Instance Method Summary collapse

Instance Method Details

#bind(from, to, options = {}) ⇒ Object



30
31
32
33
34
35
# File 'lib/legion/extensions/transport/autobuild.rb', line 30

def bind(from, to, options = {})
  from = from.new
  to = to.new
  to.bind(from, routing_key: options[:routing_key]) unless options[:routing_key].nil?
  to.bind(from) if options[:routing_key].nil?
end

#buildObject



5
6
7
8
# File 'lib/legion/extensions/transport/autobuild.rb', line 5

def build
  build_e_to_e
  build_e_to_q
end

#build_e_to_eObject



22
23
24
25
26
27
28
# File 'lib/legion/extensions/transport/autobuild.rb', line 22

def build_e_to_e
  e_to_e.each do |binding|
    options = {}
    options[:routing_key] = binding[:routing_key] unless binding[:routing_key].nil?
    bind(binding[:from], binding[:to], options)
  end
end

#build_e_to_qObject



14
15
16
17
18
19
20
# File 'lib/legion/extensions/transport/autobuild.rb', line 14

def build_e_to_q
  e_to_q.each do |binding|
    options = {}
    options[:routing_key] = binding[:routing_key] unless binding[:routing_key].nil?
    bind(binding[:from], binding[:to], options)
  end
end

#e_to_eObject



41
42
43
# File 'lib/legion/extensions/transport/autobuild.rb', line 41

def e_to_e
  []
end

#e_to_qObject



37
38
39
# File 'lib/legion/extensions/transport/autobuild.rb', line 37

def e_to_q
  []
end

#require_exchangesObject



10
# File 'lib/legion/extensions/transport/autobuild.rb', line 10

def require_exchanges; end

#require_queuesObject



12
# File 'lib/legion/extensions/transport/autobuild.rb', line 12

def require_queues; end