Class: Liebre::Actor::Consumer::Resources::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/liebre/actor/consumer/resources/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Config

Returns a new instance of Config.



7
8
9
# File 'lib/liebre/actor/consumer/resources/config.rb', line 7

def initialize spec
  @spec = spec
end

Instance Method Details

#bindObject



19
20
21
# File 'lib/liebre/actor/consumer/resources/config.rb', line 19

def bind
  spec.fetch(:bind, {})
end

#dead_exchangeObject



28
29
30
31
32
# File 'lib/liebre/actor/consumer/resources/config.rb', line 28

def dead_exchange
  {:name => error_name,
   :type => "fanout",
   :opts => raw_exchange.fetch(:opts, {})}
end

#dead_queueObject



23
24
25
26
# File 'lib/liebre/actor/consumer/resources/config.rb', line 23

def dead_queue
  {:name => error_name,
   :opts => raw_queue.fetch(:opts, {})}
end

#exchangeObject



15
16
17
# File 'lib/liebre/actor/consumer/resources/config.rb', line 15

def exchange
  raw_exchange
end

#queueObject



11
12
13
# File 'lib/liebre/actor/consumer/resources/config.rb', line 11

def queue
  raw_queue.merge(:opts => dead_letter_opts)
end