def add(type, filter=nil, &block)
      if((filter.nil? && !block_given?) || (filter && !filter.is_a?(Filter)))
        raise ArgumentError.new('Filter or proc must be provided for filter')
      end
      const = Splib.find_const(type)
      type = const unless const.nil?
      @lock.synchronize do
        @filters[type] ||= {}
      end
      if(block_given?)
        unless(block.arity == 1 || block.arity < 0)
          raise ArgumentError.new('Block must accept a parameter')
        end
        @lock.synchronize do
          @filters[type][:procs] ||= []
          unless(@filters[type][:procs].include?(block))
            @filters[type][:procs] << block
          end
        end
      end
      if(filter)
        @lock.synchronize do
          unless(@filters[type].include?(filter))
            @filters[type][:filters] ||= []
            unless(@filters[type][:filters].include?(filter))
              @filters[type][:filters] << filter
            end
          end
        end
      end
      filter ? block_given? ? [filter, block] : filter : block
    end
def add(type, filter=nil, &block)
      if((filter.nil? && !block_given?) || (filter && !filter.is_a?(Filter)))
        raise ArgumentError.new('Filter or proc must be provided for filter')
      end
      const = Splib.find_const(type)
      type = const unless const.nil?
      @lock.synchronize do
        @filters[type] ||= {}
      end
      if(block_given?)
        unless(block.arity == 1 || block.arity < 0)
          raise ArgumentError.new('Block must accept a parameter')
        end
        @lock.synchronize do
          @filters[type][:procs] ||= []
          unless(@filters[type][:procs].include?(block))
            @filters[type][:procs] << block
          end
        end
      end
      if(filter)
        @lock.synchronize do
          unless(@filters[type].include?(filter))
            @filters[type][:filters] ||= []
            unless(@filters[type][:filters].include?(filter))
              @filters[type][:filters] << filter
            end
          end
        end
      end
      filter ? block_given? ? [filter, block] : filter : block
    end
Create a new FilterManager
 type:: Object type to apply filter to
 filter:: Pipeline::Filter to add
 Add a Filter to be applied to the given types