Class: CleoQualityReview::LlmProviders::OpenAi::HttpResponse
- Inherits:
-
Struct
- Object
- Struct
- CleoQualityReview::LlmProviders::OpenAi::HttpResponse
- Defined in:
- lib/cleo_quality_review/llm_providers/open_ai.rb
Overview
Value object representing an HTTP response from OpenAI.
Instance Attribute Summary collapse
-
#body ⇒ String
readonly
Response body.
-
#status_code ⇒ Integer
readonly
HTTP status code.
Instance Method Summary collapse
-
#success? ⇒ Boolean
Check if the response indicates success.
Instance Attribute Details
#body ⇒ String (readonly)
Returns response body.
22 23 24 25 26 27 28 29 |
# File 'lib/cleo_quality_review/llm_providers/open_ai.rb', line 22 HttpResponse = Struct.new(:status_code, :body, keyword_init: true) do ## # Check if the response indicates success. # @return [Boolean] def success? (200..299).cover?(status_code.to_i) end end |
#status_code ⇒ Integer (readonly)
Returns HTTP status code.
22 23 24 25 26 27 28 29 |
# File 'lib/cleo_quality_review/llm_providers/open_ai.rb', line 22 HttpResponse = Struct.new(:status_code, :body, keyword_init: true) do ## # Check if the response indicates success. # @return [Boolean] def success? (200..299).cover?(status_code.to_i) end end |
Instance Method Details
#success? ⇒ Boolean
Check if the response indicates success.
26 27 28 |
# File 'lib/cleo_quality_review/llm_providers/open_ai.rb', line 26 def success? (200..299).cover?(status_code.to_i) end |