Module: K2ConnectRuby::K2Utilities::K2ConnectionHelper
- Extended by:
- K2ConnectionHelper
- Included in:
- K2ConnectRuby::K2Services::SendIntrospectTokenRequestService, K2ConnectRuby::K2Services::SendK2ConnectGetRequestService, K2ConnectRuby::K2Services::SendK2ConnectPostRequestService, K2ConnectRuby::K2Services::SendRequestTokenRequestService, K2ConnectRuby::K2Services::SendRevokeTokenRequestService, K2ConnectRuby::K2Services::SendTokenInfoRequestService, K2ConnectionHelper
- Defined in:
- lib/k2-connect-ruby/k2_utilities/k2_connection_helper.rb
Instance Method Summary collapse
Instance Method Details
#response_body(body) ⇒ Object
16 17 18 |
# File 'lib/k2-connect-ruby/k2_utilities/k2_connection_helper.rb', line 16 def response_body(body) body.blank? ? {} : JSON.parse(body, symbolize_names: true) end |
#response_headers(headers) ⇒ Object
12 13 14 |
# File 'lib/k2-connect-ruby/k2_utilities/k2_connection_helper.rb', line 12 def response_headers(headers) headers.blank? ? {} : JSON.parse(headers.to_json, symbolize_names: true) end |
#rest_client_error(ex) ⇒ Object
8 9 10 |
# File 'lib/k2-connect-ruby/k2_utilities/k2_connection_helper.rb', line 8 def rest_client_error(ex) ex.response.present? ? JSON.parse(ex.response.body) : {} end |