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

Version Path
gamebox-0.5.0 lib/gamebox/lib/publisher_ext.rb
gamebox-0.4.1 lib/gamebox/lib/publisher_ext.rb
gamebox-0.4.0 lib/gamebox/lib/publisher_ext.rb
gamebox-0.4.0.rc11 lib/gamebox/lib/publisher_ext.rb
gamebox-0.4.0.rc5 lib/gamebox/lib/publisher_ext.rb
gamebox-0.4.0.rc4 lib/gamebox/lib/publisher_ext.rb
gamebox-0.4.0.rc3 lib/gamebox/lib/publisher_ext.rb
gamebox-0.4.0.rc2 lib/gamebox/lib/publisher_ext.rb
gamebox-0.4.0.rc1 lib/gamebox/lib/publisher_ext.rb
gamebox-0.3.4 lib/gamebox/lib/publisher_ext.rb
gamebox-0.3.3 lib/gamebox/lib/publisher_ext.rb
gamebox-0.3.2 lib/gamebox/lib/publisher_ext.rb
gamebox-0.2.1 lib/gamebox/lib/publisher_ext.rb
gamebox-0.1.1 lib/gamebox/lib/publisher_ext.rb
gamebox-0.1.0 lib/gamebox/lib/publisher_ext.rb