Class: Gorgon::AmqpExchangeDecorator

Inherits:
Object
  • Object
show all
Defined in:
lib/gorgon/amqp_service.rb

Instance Method Summary collapse

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