Class: Smith::Messaging::AmqpOptions
- Inherits:
-
Object
- Object
- Smith::Messaging::AmqpOptions
- Includes:
- Logger
- Defined in:
- lib/smith/messaging/amqp_options.rb
Instance Attribute Summary collapse
-
#routing_key ⇒ Object
Returns the value of attribute routing_key.
Instance Method Summary collapse
- #exchange(*extra_opts) ⇒ Object
-
#initialize(options = {}) ⇒ AmqpOptions
constructor
A new instance of AmqpOptions.
- #pop(*extra_opts) ⇒ Object
- #publish(*extra_opts) ⇒ Object
- #queue(*extra_opts) ⇒ Object
- #subscribe(*extra_opts) ⇒ Object
Methods included from Logger
Constructor Details
#initialize(options = {}) ⇒ AmqpOptions
Returns a new instance of AmqpOptions.
9 10 11 12 |
# File 'lib/smith/messaging/amqp_options.rb', line 9 def initialize(={}) @options = @options_map = {:strict => {:immediate => true, :mandatory => true}} end |
Instance Attribute Details
#routing_key ⇒ Object
Returns the value of attribute routing_key.
7 8 9 |
# File 'lib/smith/messaging/amqp_options.rb', line 7 def routing_key @routing_key end |
Instance Method Details
#exchange(*extra_opts) ⇒ Object
14 15 16 |
# File 'lib/smith/messaging/amqp_options.rb', line 14 def exchange(*extra_opts) merge(Smith.config.amqp.exchange.to_hash, @options, extra_opts) end |
#pop(*extra_opts) ⇒ Object
22 23 24 |
# File 'lib/smith/messaging/amqp_options.rb', line 22 def pop(*extra_opts) merge(Smith.config.amqp.pop.to_hash, @options, extra_opts) end |
#publish(*extra_opts) ⇒ Object
26 27 28 |
# File 'lib/smith/messaging/amqp_options.rb', line 26 def publish(*extra_opts) merge(Smith.config.amqp.publish.to_hash, {:routing_key => routing_key, :persistent => true}, extra_opts) end |