Module: XingApi::ResponseHandler
- Included in:
- Client
- Defined in:
- lib/xing_api/response_handler.rb
Constant Summary collapse
- OAUTH_ERROR_RESPONSES =
%w( INVALID_OAUTH_CONSUMER CONSUMER_MISMATCH INVALID_OAUTH_SIGNATURE_METHOD INVALID_OAUTH_SIGNATURE INVALID_TIMESTAMP TIMESTAMP_EXPIRED NONCE_ALREADY_USED NONCE_MISSING INVALID_OAUTH_VERSION REQUIRED_PARAMETER_MISSING ).freeze
Instance Method Summary collapse
Instance Method Details
#handle(response) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/xing_api/response_handler.rb', line 16 def handle(response) return Response.new('{}', response.to_hash) if response.code.to_i == 204 unless (200..299).cover?(response.code.to_i) raise_failed_response!(response) end Response.new( response.body.to_s, response.to_hash ) end |