def purge(*args)
      c = 'purge'
      c << ".#{args.shift}" if [:url, :hash, :list].include?(args.first)
      response = cmd(c, *args)
      case c
      when 'purge.list'
        response.split("\n").map do |line|
          a = line.split("\t")
          [a[0].to_i, a[1]]
        end
      else
        bool response
      end
    end
def purge(*args)
      c = 'purge'
      c << ".#{args.shift}" if [:url, :hash, :list].include?(args.first)
      response = cmd(c, *args)
      case c
      when 'purge.list'
        response.split("\n").map do |line|
          a = line.split("\t")
          [a[0].to_i, a[1]]
        end
      else
        bool response
      end
    end
Purge objects from the cache or show the purge queue.

 Takes one or two arguments:

 1.
  .purge :url, <regexp>
  .purge :hash, <regexp>

 <regexp> is a string containing a varnish compatible regexp

 2.
  .purge <costum-purge-conditions>
  .purge :list

 Returns true for purging, returns an array containing the purge queue
 for :list

 Ex.:
   v = Varnish::Client.new
   v.purge :url, '.*'

   v.purge "req.http.host ~ www.foo.com && req.http.url ~ images"

   v.purge :list
   #=> [[1, "req.url ~ .*"]]