Class: Gorgon::AmqpExchangeDecorator
- Inherits:
-
Object
- Object
- Gorgon::AmqpExchangeDecorator
- Defined in:
- lib/gorgon/amqp_service.rb
Instance Method Summary collapse
-
#initialize(exchange) ⇒ AmqpExchangeDecorator
constructor
A new instance of AmqpExchangeDecorator.
- #publish(msg) ⇒ Object
Constructor Details
#initialize(exchange) ⇒ AmqpExchangeDecorator
Returns a new instance of AmqpExchangeDecorator.
18 19 20 |
# File 'lib/gorgon/amqp_service.rb', line 18 def initialize exchange @exchange = exchange end |
Instance Method Details
#publish(msg) ⇒ Object
22 23 24 25 |
# File 'lib/gorgon/amqp_service.rb', line 22 def publish msg serialized_msg = Yajl::Encoder.encode(msg) @exchange.publish serialized_msg end |