lib/gooddata/connection.rb in gooddata-0.6.6 vs lib/gooddata/connection.rb in gooddata-0.6.7
- old
+ new
@@ -65,7 +65,14 @@
server_cookies = options[:cookies]
connection.merge_cookies!(server_cookies)
connection.status = :logged_in
connection
end
+
+ def with_connection(options = nil, second_options = nil, third_options = {}, &bl)
+ connection = connect(options, second_options, third_options)
+ bl.call(connection)
+ ensure
+ disconnect
+ end
end
end