def query_pipe(object, query_hash)
      if object[0].is_a?(Hash)
        query_hash.map {|field,query|
          field = field.to_i if field.to_s[/^\d+$/]
          object.select {|e| e[field].to_s =~ /#{query}/i }
        }.flatten.uniq
      else
        query_hash.map {|field,query| object.select {|e| e.send(field).to_s =~ /#{query}/i } }.flatten.uniq
      end
    rescue NoMethodError
      $stderr.puts "Query failed with nonexistant method '#{$!.message[/`(.*)'/,1]}'"
    end
def query_pipe(object, query_hash)
      if object[0].is_a?(Hash)
        query_hash.map {|field,query|
          field = field.to_i if field.to_s[/^\d+$/]
          object.select {|e| e[field].to_s =~ /#{query}/i }
        }.flatten.uniq
      else
        query_hash.map {|field,query| object.select {|e| e.send(field).to_s =~ /#{query}/i } }.flatten.uniq
      end
    rescue NoMethodError
      $stderr.puts "Query failed with nonexistant method '#{$!.message[/`(.*)'/,1]}'"
    end
Case-insensitive search an array of objects or hashes for the :query option.
 This option is a hash of fields mapped to their search terms. Searches are OR-ed.
 When searching hashes, numerical string keys in query_hash are converted to actual numbers to
 interface with Hirb.