Class: ShopifyAPI::Clients::HttpResponse
- Inherits:
-
Object
- Object
- ShopifyAPI::Clients::HttpResponse
- Extended by:
- T::Sig
- Defined in:
- lib/shopify_api/clients/http_response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#next_page_info ⇒ Object
readonly
Returns the value of attribute next_page_info.
-
#prev_page_info ⇒ Object
readonly
Returns the value of attribute prev_page_info.
Instance Method Summary collapse
-
#initialize(code:, headers:, body:) ⇒ HttpResponse
constructor
A new instance of HttpResponse.
- #ok? ⇒ Boolean
Constructor Details
#initialize(code:, headers:, body:) ⇒ HttpResponse
Returns a new instance of HttpResponse.
28 29 30 31 32 33 34 35 36 |
# File 'lib/shopify_api/clients/http_response.rb', line 28 def initialize(code:, headers:, body:) @code = code @headers = headers @body = body @prev_page_info = T.let(nil, T.nilable(String)) @next_page_info = T.let(nil, T.nilable(String)) @prev_page_info, @next_page_info = parse_link_header end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
16 17 18 |
# File 'lib/shopify_api/clients/http_response.rb', line 16 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/shopify_api/clients/http_response.rb', line 10 def code @code end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
13 14 15 |
# File 'lib/shopify_api/clients/http_response.rb', line 13 def headers @headers end |
#next_page_info ⇒ Object (readonly)
Returns the value of attribute next_page_info.
19 20 21 |
# File 'lib/shopify_api/clients/http_response.rb', line 19 def next_page_info @next_page_info end |
#prev_page_info ⇒ Object (readonly)
Returns the value of attribute prev_page_info.
19 20 21 |
# File 'lib/shopify_api/clients/http_response.rb', line 19 def prev_page_info @prev_page_info end |
Instance Method Details
#ok? ⇒ Boolean
39 40 41 |
# File 'lib/shopify_api/clients/http_response.rb', line 39 def ok? code >= 200 && code <= 299 end |