Class: BigCommerce::ManagementAPI::ResponseHeaders
- Inherits:
-
Object
- Object
- BigCommerce::ManagementAPI::ResponseHeaders
- Defined in:
- lib/big_commerce/management_api/endpoint.rb
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(headers) ⇒ ResponseHeaders
constructor
A new instance of ResponseHeaders.
- #request_id ⇒ Object
Constructor Details
#initialize(headers) ⇒ ResponseHeaders
Returns a new instance of ResponseHeaders.
12 13 14 |
# File 'lib/big_commerce/management_api/endpoint.rb', line 12 def initialize(headers) @headers = headers || {} end |
Instance Method Details
#[](name) ⇒ Object
16 17 18 |
# File 'lib/big_commerce/management_api/endpoint.rb', line 16 def [](name) @headers[name] end |
#request_id ⇒ Object
20 21 22 23 |
# File 'lib/big_commerce/management_api/endpoint.rb', line 20 def request_id value = @headers["x-request-id"] value.is_a?(Array) ? value[0] : value end |