lib/gamebox/core/input_manager.rb
# removes all blocks that are in the scope of listener's instance.
# clears all listeners if listener is nil
removes all blocks that are in the scope of listener's instance.
clears all listeners if listener is nil
removes all blocks that are in the scope of listener ' s instance . clears all listeners if listener is nil
def clear_hooks(listener=nil)
    if listener
      for event_klass, id_listeners in @hooks
        for key in id_listeners.keys.dup
          id_listeners[key].delete_if do |block|
            block_self = @block_self_lookup.delete block
            block_self.equal?(listener)
          end
        end
      end
      for key in @non_id_hooks.keys.dup
        @non_id_hooks[key].delete_if do |block|
          eval('self',block.binding).equal?(listener)
        end
      end
    else
      @hooks = {}
      @non_id_hooks = {}
    end
  end
def clear_hooks ( listener = nil ) if listener for event_klass , id_listeners in @hooks for key in id_listeners . keys . dup id_listeners [ key ] . delete_if do | block | block_self = @block_self_lookup . delete block block_self . equal? ( listener ) end end end for key in @non_id_hooks . keys . dup @non_id_hooks [ key ] . delete_if do | block | eval ( 'self' , block . binding ) . equal? ( listener ) end end else @hooks = { } @non_id_hooks = { } end end
removes all blocks that are in the scope of listener's instance.
removes all blocks that are in the scope of listener ' s instance .
listener
<not_specific>