require 'net/http'

module Net

  class HTTP

    class Purge < HTTPRequest
      METHOD = 'PURGE'
      REQUEST_HAS_BODY = false
      RESPONSE_HAS_BODY = true
    end

  end

end

purge_path = "/"
varnish_host = "localhost"
req = Net::HTTP::Purge.new purge_path
res = Net::HTTP.start(varnish_host) do |http|
  http.request req
end
