Sha256: d28e4e3726629592e6080a235166e25a1de152bea9113c8e3f367a3e9904928f
Contents?: true
Size: 696 Bytes
Versions: 14
Compression:
Stored size: 696 Bytes
Contents
module Fog class Connection def initialize(url, persistent=false, params={}) @excon = Excon.new(url, params) @persistent = persistent end def request(params, &block) unless @persistent reset end unless block_given? if (parser = params.delete(:parser)) body = Nokogiri::XML::SAX::PushParser.new(parser) params[:response_block] = lambda { |chunk, remaining, total| body << chunk } end end response = @excon.request(params, &block) if parser body.finish response.body = parser.response end response end def reset @excon.reset end end end
Version data entries
14 entries across 14 versions & 7 rubygems