Sha256: ec464e40b858852ca58289ef17533c34b4a6ff17d90d7257eebb5879b9baa12e
Contents?: true
Size: 566 Bytes
Versions: 15
Compression:
Stored size: 566 Bytes
Contents
module Publisher module InstanceMethods def can_fire?(event) events = self.class.class_eval { @published_events } events = self.class.published_events return true if events == :any_event_is_ok return false unless events and events.include?(event) return true end def unsubscribe_all(listener) if @subscriptions for event in @subscriptions.keys @subscriptions[event].delete_if do |block| eval('self',block.binding).equal?(listener) end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems