Class: Sms::LogSubscriber

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/sms/log_subscriber.rb

Instance Method Summary collapse

Instance Method Details

#deliver(event) ⇒ Object



7
8
9
10
11
# File 'lib/sms/log_subscriber.rb', line 7

def deliver(event)
  recipient = event.payload[:to]
  info("Sent sms to #{recipient} (%1.fms)" % event.duration)
  debug(event.payload[:text])
end

#receive(event) ⇒ Object



13
14
15
16
17
# File 'lib/sms/log_subscriber.rb', line 13

def receive(event)
  sender = event.payload[:from]
  info("Received sms from #{sender} (%1.fms)" % event.duration)
  debug(event.payload[:text])
end