Class: MAuth::Faraday::Response

Inherits:
Response
  • Object
show all
Includes:
Signed
Defined in:
lib/mauth/faraday.rb

Overview

representation of a Response (incoming) composed from a Faraday response env which can be passed to a Mauth::Client for authentication

Constant Summary

Constants inherited from Response

Response::SIGNATURE_COMPONENTS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Signed

#signature, #signature_app_uuid, #signature_info, #signature_token

Methods included from Signable

#string_to_sign

Constructor Details

#initialize(response_env) ⇒ Response

Returns a new instance of Response.



56
57
58
# File 'lib/mauth/faraday.rb', line 56

def initialize(response_env)
  @response_env = response_env
end

Instance Attribute Details

#response_envObject (readonly)

Returns the value of attribute response_env.



55
56
57
# File 'lib/mauth/faraday.rb', line 55

def response_env
  @response_env
end

Instance Method Details

#attributes_for_signingObject



60
61
62
# File 'lib/mauth/faraday.rb', line 60

def attributes_for_signing
  @attributes_for_signing ||= { status_code: response_env[:status], body: response_env[:body] }
end

#x_mws_authenticationObject



68
69
70
# File 'lib/mauth/faraday.rb', line 68

def x_mws_authentication
  @response_env[:response_headers]['x-mws-authentication']
end

#x_mws_timeObject



64
65
66
# File 'lib/mauth/faraday.rb', line 64

def x_mws_time
  @response_env[:response_headers]['x-mws-time']
end