Class: CleoQualityReview::GitHubClient::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/cleo_quality_review/github_client.rb

Overview

Wrapped HTTP response

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyString (readonly)

Returns raw response body.

Returns:

  • (String)

    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_codeInteger (readonly)

Returns HTTP status code.

Returns:

  • (Integer)

    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.

Returns:

  • (Boolean)

    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