Sha256: 7b4bd23e5a47eb6af593ebc1f85903e660a053741f956b51a496196995346ba2

Contents?: true

Size: 475 Bytes

Versions: 4

Compression:

Stored size: 475 Bytes

Contents

module NotificationCenter
  module CoreExt
    module Module
      def observe *events
        stored_events = NotificationCenter.events.dup
        for event in events
          next if stored_events.has_key? event
          stored_events[event] += Array self
          stored_events[event] = stored_events[event].uniq
        end
        NotificationCenter.events = stored_events
      end
    end
  end
end

::Module.__send__ :include, NotificationCenter::CoreExt::Module

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
notification_center-0.3.2 lib/notification_center/core_ext/module.rb
notification_center-0.3.1 lib/notification_center/core_ext/module.rb
notification_center-0.3 lib/notification_center/core_ext/module.rb
notification_center-0.2 lib/notification_center/core_ext/module.rb