Class: CleoQualityReview::GitHubClient::Response
- Inherits:
-
Struct
- Object
- Struct
- CleoQualityReview::GitHubClient::Response
- Defined in:
- lib/cleo_quality_review/github_client.rb
Overview
Wrapped HTTP response
Instance Attribute Summary collapse
-
#body ⇒ String
readonly
Raw response body.
-
#status_code ⇒ Integer
readonly
HTTP status code.
Instance Method Summary collapse
-
#success? ⇒ Boolean
Whether the response status is in the 2xx range.
Instance Attribute Details
#body ⇒ String (readonly)
Returns raw response body.
21 22 23 24 25 26 27 |
# File 'lib/cleo_quality_review/github_client.rb', line 21 Response = Struct.new(:status_code, :body, keyword_init: true) do ## # @return [Boolean] whether the response status is in the 2xx range def success? (200..299).cover?(status_code.to_i) end end |
#status_code ⇒ Integer (readonly)
Returns HTTP status code.
21 22 23 24 25 26 27 |
# File 'lib/cleo_quality_review/github_client.rb', line 21 Response = Struct.new(:status_code, :body, keyword_init: true) do ## # @return [Boolean] whether the response status is in the 2xx range def success? (200..299).cover?(status_code.to_i) end end |
Instance Method Details
#success? ⇒ Boolean
Returns whether the response status is in the 2xx range.
24 25 26 |
# File 'lib/cleo_quality_review/github_client.rb', line 24 def success? (200..299).cover?(status_code.to_i) end |