Class: GroqRuby::Response

Inherits:
Data
  • Object
show all
Defined in:
lib/groq_ruby/response.rb

Overview

Value object representing a parsed HTTP response. The body is either a decoded JSON object (Hash/Array) or a raw String for binary responses.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



4
5
6
# File 'lib/groq_ruby/response.rb', line 4

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



4
5
6
# File 'lib/groq_ruby/response.rb', line 4

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



4
5
6
# File 'lib/groq_ruby/response.rb', line 4

def status
  @status
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/groq_ruby/response.rb', line 5

def success?
  status.between?(200, 299)
end