Sha256: 41fcdf30b4a6ba568f9df886150825999a487cae77845b589b5c9b95f4186fb8
Contents?: true
Size: 678 Bytes
Versions: 21
Compression:
Stored size: 678 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) 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
21 entries across 21 versions & 5 rubygems