Class: Fog::Connection
- Inherits:
-
Object
- Object
- Fog::Connection
- Defined in:
- lib/fog/connection.rb
Instance Method Summary collapse
-
#initialize(url) ⇒ Connection
constructor
A new instance of Connection.
- #request(params) ⇒ Object
Constructor Details
#initialize(url) ⇒ Connection
Returns a new instance of Connection.
4 5 6 |
# File 'lib/fog/connection.rb', line 4 def initialize(url) @excon = Excon.new(url) end |
Instance Method Details
#request(params) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/connection.rb', line 8 def request(params) if parser = params.delete(:parser) body = Nokogiri::XML::SAX::PushParser.new(parser) params[:block] = lambda { |chunk| body << chunk } end response = @excon.request(params) if parser body.finish response.body = parser.response end response end |