Sha256: efe65179a11a003903e0c08d2d76ea570eb0a0a029022a7e21f68c0c3db77e03
Contents?: true
Size: 619 Bytes
Versions: 17
Compression:
Stored size: 619 Bytes
Contents
module Betterlog module Notifiers class_attr_accessor :notifiers self.notifiers = Set[] def self.register(notifier) notifier.respond_to?(:notify) or raise TypeError, "notifier has to respond to notify(message, hash) interface" notifiers << notifier self end def self.notify(event) notifiers.each do |notifier| notifier.notify(event.notify?, event.as_hash) end end def self.context(data_hash) notifiers.each do |notifier| notifier.respond_to?(:context) or next notifier.context(data_hash) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems