Sha256: 3a62a0b174a865cbb5b1994a577340a1f2267b41c32e65471f0f6588ca094f25
Contents?: true
Size: 641 Bytes
Versions: 67
Compression:
Stored size: 641 Bytes
Contents
module Fog class Connection def initialize(url, persistent=false) @excon = Excon.new(url) @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) block = lambda { |chunk| 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
67 entries across 67 versions & 3 rubygems