Sha256: cdd822c1ad16525b7ac32370633f47f0db66259041d61f80bf4dca9030901ab5
Contents?: true
Size: 421 Bytes
Versions: 12
Compression:
Stored size: 421 Bytes
Contents
require 'active_support/notifications' class Peastash module Watch def watch(event, opts = {}, &block) event_group = opts[:event_group] || event ActiveSupport::Notifications.subscribe(event) do |*args| # Calling the processing block with the Notification args and the store block.call(*args, self.store[event_group]) end end end end Peastash.send :include, Peastash::Watch
Version data entries
12 entries across 12 versions & 1 rubygems