Module: Chatterbox

Extended by:
Chatterbox
Included in:
Chatterbox
Defined in:
lib/chatterbox.rb,
lib/chatterbox/notification.rb,
lib/chatterbox/rails_catcher.rb,
lib/consumers/email_consumer.rb

Defined Under Namespace

Modules: Publishers, RailsCatcher Classes: EmailConsumer, Mailer, Notification

Instance Method Summary collapse

Instance Method Details

#handle_notice(message) ⇒ Object



6
7
8
9
# File 'lib/chatterbox.rb', line 6

def handle_notice(message)
  notice = Notification.new(message).notice
  publish_notice(notice)
end

#loggerObject



15
16
17
# File 'lib/chatterbox.rb', line 15

def logger
  @logger ||= rails_default_logger || Logger.new(STDOUT)
end

#logger=(logger) ⇒ Object



19
20
21
# File 'lib/chatterbox.rb', line 19

def logger=(logger)
  @logger = logger
end

#publish_notice(notice) ⇒ Object



11
12
13
# File 'lib/chatterbox.rb', line 11

def publish_notice(notice)
  Publishers.publishers.each { |p| p.call(notice) }
end

#rails_default_loggerObject



23
24
25
# File 'lib/chatterbox.rb', line 23

def rails_default_logger
  defined?(RAILS_DEFAULT_LOGGER) ? RAILS_DEFAULT_LOGGER : nil
end