Sha256: 9ea7b888dc8b43240d2f27519e1f9a6b3bc6c5bd96c68f198457f202fa849219
Contents?: true
Size: 899 Bytes
Versions: 2
Compression:
Stored size: 899 Bytes
Contents
module OAuthActiveResource class Connection < ActiveResource::Connection def initialize(oauth_connection, *args) @oauth_connection = oauth_connection super(*args) end # an alternative for the get method, which doesnt tries to decode the response def get_without_decoding(path, headers = {}) request(:get, path, build_request_headers(headers, :get)) end # make handle_response public def handle_response(*args) super(*args) end private def request(method, path, *arguments) if @oauth_connection == nil super(method, path, *arguments) else response = @oauth_connection.request(method, "#{site.scheme}://#{site.host}:#{site.port}#{path}", *arguments) handle_response(response) end rescue Timeout::Error => e raise TimeoutError.new(e.message) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jwagener-oauth-active-resource-0.1.5 | lib/oauth_active_resource/connection.rb |
jwagener-oauth-active-resource-0.1.6 | lib/oauth_active_resource/connection.rb |