Class: BigCommerce::ManagementAPI::ResponseHeaders

Inherits:
Object
  • Object
show all
Defined in:
lib/big_commerce/management_api/endpoint.rb

Instance Method Summary collapse

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_idObject



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