Parent

Files

Class/Module Index [+]

Quicksearch

Fog::Connection

Public Class Methods

new(url, persistent=false, params={}) click to toggle source
# File lib/fog/core/connection.rb, line 4
def initialize(url, persistent=false, params={})
  @excon = Excon.new(url, params)
  @persistent = persistent
end

Public Instance Methods

request(params, &block) click to toggle source
# File lib/fog/core/connection.rb, line 9
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
reset() click to toggle source
# File lib/fog/core/connection.rb, line 30
def reset
  @excon.reset
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.