Class: HoptoadZmqNotifier::Sender

Inherits:
Object
  • Object
show all
Defined in:
lib/hoptoad_zmq_notifier/sender.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Sender

Returns a new instance of Sender.



12
13
14
15
16
# File 'lib/hoptoad_zmq_notifier/sender.rb', line 12

def initialize(options = {})
  [:mailbox_size, :uri].each do |option|
    instance_variable_set("@#{option}", options[option])
  end
end

Instance Method Details

#send_to_hoptoad(data) ⇒ Object



7
8
9
10
# File 'lib/hoptoad_zmq_notifier/sender.rb', line 7

def send_to_hoptoad data
  logger.debug { "Sending request to #{@uri}:\n#{data}" } if logger
  socket.send_string data, ZMQ::NOBLOCK
end