Class: Stripe::APIRequestor::RequestLogContext
- Inherits:
-
Object
- Object
- Stripe::APIRequestor::RequestLogContext
- Defined in:
- lib/stripe/api_requestor.rb
Overview
RequestLogContext stores information about a request that’s begin made so that we can log certain information. It’s useful because it means that we don’t have to pass around as many parameters.
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#body ⇒ Object
Returns the value of attribute body.
-
#idempotency_key ⇒ Object
Returns the value of attribute idempotency_key.
-
#method ⇒ Object
Returns the value of attribute method.
-
#path ⇒ Object
Returns the value of attribute path.
-
#query ⇒ Object
Returns the value of attribute query.
-
#request_id ⇒ Object
Returns the value of attribute request_id.
Instance Method Summary collapse
-
#dup_from_response_headers(headers) ⇒ Object
The idea with this method is that we might want to update some of context information because a response that we’ve received from the API contains information that’s more authoritative than what we started with for a request.
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
1031 1032 1033 |
# File 'lib/stripe/api_requestor.rb', line 1031 def account @account end |
#api_key ⇒ Object
Returns the value of attribute api_key.
1031 1032 1033 |
# File 'lib/stripe/api_requestor.rb', line 1031 def api_key @api_key end |
#api_version ⇒ Object
Returns the value of attribute api_version.
1031 1032 1033 |
# File 'lib/stripe/api_requestor.rb', line 1031 def api_version @api_version end |
#body ⇒ Object
Returns the value of attribute body.
1031 1032 1033 |
# File 'lib/stripe/api_requestor.rb', line 1031 def body @body end |
#idempotency_key ⇒ Object
Returns the value of attribute idempotency_key.
1031 1032 1033 |
# File 'lib/stripe/api_requestor.rb', line 1031 def idempotency_key @idempotency_key end |
#method ⇒ Object
Returns the value of attribute method.
1031 1032 1033 |
# File 'lib/stripe/api_requestor.rb', line 1031 def method @method end |
#path ⇒ Object
Returns the value of attribute path.
1031 1032 1033 |
# File 'lib/stripe/api_requestor.rb', line 1031 def path @path end |
#query ⇒ Object
Returns the value of attribute query.
1031 1032 1033 |
# File 'lib/stripe/api_requestor.rb', line 1031 def query @query end |
#request_id ⇒ Object
Returns the value of attribute request_id.
1031 1032 1033 |
# File 'lib/stripe/api_requestor.rb', line 1031 def request_id @request_id end |
Instance Method Details
#dup_from_response_headers(headers) ⇒ Object
The idea with this method is that we might want to update some of context information because a response that we’ve received from the API contains information that’s more authoritative than what we started with for a request. For example, we should trust whatever came back in a ‘Stripe-Version` header beyond what configuration information that we might have had available.
1039 1040 1041 1042 1043 1044 1045 1046 |
# File 'lib/stripe/api_requestor.rb', line 1039 def dup_from_response_headers(headers) context = dup context.account = headers["Stripe-Account"] context.api_version = headers["Stripe-Version"] context.idempotency_key = headers["Idempotency-Key"] context.request_id = headers["Request-Id"] context end |