Class: ShopifyApiBruv::Clients::HttpResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/shopify_api_bruv/clients/http_response.rb

Direct Known Subclasses

Rest::HttpResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code:, headers:, body:) ⇒ HttpResponse

Returns a new instance of HttpResponse.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/shopify_api_bruv/clients/http_response.rb', line 8

def initialize(code:, headers:, body:)
  @code = code
  @headers = headers
  @body = body

  validate

  ShopifyApiBruv.logger(
    method: :info,
    message: "Shopify API Response (Code: #{code}):\nHeaders:\n#{headers}\n\nBody:\n#{body}"
  )
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/shopify_api_bruv/clients/http_response.rb', line 6

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'lib/shopify_api_bruv/clients/http_response.rb', line 6

def code
  @code
end

#headersObject (readonly)

Returns the value of attribute headers.



6
7
8
# File 'lib/shopify_api_bruv/clients/http_response.rb', line 6

def headers
  @headers
end