Class: OAuthActiveResource::Connection
- Inherits:
-
ActiveResource::Connection
- Object
- ActiveResource::Connection
- OAuthActiveResource::Connection
- Defined in:
- lib/oauth_active_resource/connection.rb
Instance Method Summary collapse
-
#get_without_decoding(path, headers = {}) ⇒ Object
an alternative for the get method, which doesnt tries to decode the response.
-
#handle_response(response) ⇒ Object
make handle_response public and add error message from body if possible.
-
#initialize(oauth_connection, *args) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(oauth_connection, *args) ⇒ Connection
Returns a new instance of Connection.
3 4 5 6 |
# File 'lib/oauth_active_resource/connection.rb', line 3 def initialize(oauth_connection, *args) @oauth_connection = oauth_connection super(*args) end |
Instance Method Details
#get_without_decoding(path, headers = {}) ⇒ Object
an alternative for the get method, which doesnt tries to decode the response
9 10 11 |
# File 'lib/oauth_active_resource/connection.rb', line 9 def get_without_decoding(path, headers = {}) request(:get, path, build_request_headers(headers, :get)) end |
#handle_response(response) ⇒ Object
make handle_response public and add error message from body if possible
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/oauth_active_resource/connection.rb', line 14 def handle_response(response) return super(response) rescue ActiveResource::ClientError => exc begin # ugly code to insert the error_message into response = "#{format.decode response.body}" if not .nil? or == "" exc.response.instance_eval do || @message = end end ensure raise exc end end |