class Sender
Public Class Methods
new(config)
click to toggle source
# File lib/test_driven_lighting/sender.rb, line 5 def initialize config @connection = Bunny.new("amqp://#{config[:bunny_username]}:#{config[:bunny_password]}@#{config[:bunny_host]}").start @channel = @connection.create_channel @exchange = @channel.fanout('lighting.messages') end
Public Instance Methods
close_connection()
click to toggle source
# File lib/test_driven_lighting/sender.rb, line 16 def close_connection @connection.close end
message_send(status, type)
click to toggle source
# File lib/test_driven_lighting/sender.rb, line 11 def message_send status, type message = Hash status: status, type: type @exchange.publish message.to_json end